diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/activity/AboutBuildmLearn.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/activity/AboutBuildmLearn.java index 029c9a1f..c6d53bb1 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/activity/AboutBuildmLearn.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/activity/AboutBuildmLearn.java @@ -32,11 +32,11 @@ protected void onCreate(Bundle savedInstanceState) { pInfo = getPackageManager().getPackageInfo(getPackageName(), 0); String version = pInfo.versionName; assert findViewById(R.id.app_version) != null; - ((TextView) findViewById(R.id.app_version)).setText(String.format(Locale.ENGLISH, "Version: %s", version)); + ((TextView) findViewById(R.id.app_version)).setText(String.format(Locale.ENGLISH, getString(R.string.Version)+ version)); } catch (PackageManager.NameNotFoundException e) { assert findViewById(R.id.app_version) != null; assert ((TextView) findViewById(R.id.app_version)) != null; - ((TextView) findViewById(R.id.app_version)).setText("Version: 1.0"); + ((TextView) findViewById(R.id.app_version)).setText(R.string.Version1); e.printStackTrace(); } diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/activity/DeepLinkerActivity.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/activity/DeepLinkerActivity.java index bcbaf985..dc6d1106 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/activity/DeepLinkerActivity.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/activity/DeepLinkerActivity.java @@ -7,6 +7,7 @@ import android.util.Log; import android.widget.Toast; +import org.buildmlearn.toolkit.R; import org.buildmlearn.toolkit.constant.Constants; import org.buildmlearn.toolkit.model.SavedProject; import org.buildmlearn.toolkit.model.Template; @@ -57,7 +58,7 @@ protected void onCreate(Bundle savedInstanceState) { return; } } - Toast.makeText(this, "Invalid project file", Toast.LENGTH_SHORT).show(); + Toast.makeText(this, R.string.InvalidProjectFile, Toast.LENGTH_SHORT).show(); finish(); } catch (ParserConfigurationException | IOException | SAXException e) { e.printStackTrace(); diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/activity/HomeActivity.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/activity/HomeActivity.java index 90f7cae1..8bff8d9c 100755 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/activity/HomeActivity.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/activity/HomeActivity.java @@ -211,7 +211,7 @@ public void onBackPressed() { finish(); } backPressedOnce=true; - Toast.makeText(this, "Tap back once more to exit.", Toast.LENGTH_SHORT).show(); + Toast.makeText(this, R.string.DoubleExit, Toast.LENGTH_SHORT).show(); new Handler().postDelayed(new Runnable() { @Override diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/activity/TemplateEditor.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/activity/TemplateEditor.java index 8ac2f256..71489e11 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/activity/TemplateEditor.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/activity/TemplateEditor.java @@ -74,7 +74,7 @@ public class TemplateEditor extends AppCompatActivity { private final Handler handlerToast = new Handler() { public void handleMessage(Message message) { if (message.arg1 == -1) { - Toast.makeText(TemplateEditor.this, "Build unsuccessful", Toast.LENGTH_SHORT).show(); + Toast.makeText(TemplateEditor.this, R.string.Build_Unsuccessful, Toast.LENGTH_SHORT).show(); } } }; @@ -107,7 +107,7 @@ protected void onCreate(Bundle savedInstanceState) { toolkit = (ToolkitApplication) getApplicationContext(); templateId = getIntent().getIntExtra(Constants.TEMPLATE_ID, -1); if (templateId == -1) { - Toast.makeText(this, "Invalid template ID, closing Template Editor activity", Toast.LENGTH_LONG).show(); + Toast.makeText(this, R.string.Invalid_Temp_ID, Toast.LENGTH_LONG).show(); finish(); } @@ -421,7 +421,7 @@ public void onClick(DialogInterface dialog, int id) { case R.id.share_project: savedFilePath = saveProject(); - if(("File already exists".equals(savedFilePath))){ + if((getString(R.string.FileAlready).equals(savedFilePath))){ return; } @@ -440,7 +440,7 @@ public void onClick(DialogInterface dialog, int id) { case R.id.share_apk: savedFilePath = saveProject(); - if(("File already exists".equals(savedFilePath))){ + if((getString(R.string.FileAlready).equals(savedFilePath))){ return; } if (savedFilePath == null || savedFilePath.length() == 0) { @@ -463,7 +463,7 @@ public void onClick(DialogInterface dialog, int id) { signer.setSignerThreadListener(new SignerThread.OnSignComplete() { @Override public void onSuccess(final String path) { - Log.d(TAG, "APK generated"); + Log.d(TAG, getString(R.string.APKGenerated)); mApkGenerationDialog.dismiss(); Uri fileUri = Uri.fromFile(new File(path)); @@ -505,7 +505,7 @@ public void onFail(Exception e) { break; case R.id.save_apk: savedFilePath = saveProject(); - if(("File already exists".equals(savedFilePath))){ + if((getString(R.string.FileAlready).equals(savedFilePath))){ return; } if (savedFilePath == null || savedFilePath.length() == 0) { @@ -528,16 +528,16 @@ public void onFail(Exception e) { signer.setSignerThreadListener(new SignerThread.OnSignComplete() { @Override public void onSuccess(final String path) { - Log.d(TAG, "APK generated"); + Log.d(TAG, getString(R.string.APKGenerated)); mApkGenerationDialog.dismiss(); runOnUiThread(new Runnable() { @Override public void run() { AlertDialog dialog = new AlertDialog.Builder(TemplateEditor.this) - .setTitle("Apk Generated") - .setMessage("Apk file saved at " + path) - .setPositiveButton("okay", new DialogInterface.OnClickListener() { + .setTitle(R.string.APKGenerated) + .setMessage(getString(R.string.APK_address) + path) + .setPositiveButton(R.string.quiz_ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); @@ -650,7 +650,7 @@ private String saveProject() { String title = ((EditText) findViewById(R.id.template_title)).getText().toString(); if ("".equals(author)) { assert authorEditText != null; - authorEditText.setError("Author name is required"); + authorEditText.setError(getString(R.string.valid_author)); } else if ("".equals(title)) { assert titleEditText != null; titleEditText.setError(getResources().getString(R.string.title_error)); @@ -689,11 +689,11 @@ private String saveProject() { Element dataElement = doc.createElement("data"); rootElement.appendChild(dataElement); if (selectedTemplate.getItems(doc).size() == 0 || (selectedTemplate.getItems(doc).size() < 2 && (templateId == 5 || templateId == 7))) { - Toast.makeText(this, "Unable to perform action: No Data", Toast.LENGTH_SHORT).show(); + Toast.makeText(this, R.string.NoData, Toast.LENGTH_SHORT).show(); return null; } if (selectedTemplate.getItems(doc).get(0).getTagName().equals("item") && (templateId == 5 || templateId == 7)) { - Toast.makeText(this, "Unable to perform action: Add Meta Details", Toast.LENGTH_SHORT).show(); + Toast.makeText(this, R.string.AddMetaDetails, Toast.LENGTH_SHORT).show(); return null; } for (Element item : selectedTemplate.getItems(doc)) { @@ -711,12 +711,12 @@ private String saveProject() { boolean isSaved=FileUtils.saveXmlFile(toolkit.getSavedDir(), saveFileName, doc); if(isSaved) { oldFileName = toolkit.getSavedDir() + saveFileName; - Toast.makeText(this, "Project Successfully Saved!", Toast.LENGTH_SHORT).show(); + Toast.makeText(this, R.string.Success_Save_Project, Toast.LENGTH_SHORT).show(); return oldFileName; } else { - titleEditText.setError("File Already exists"); - return "File already exists"; + titleEditText.setError(getString(R.string.FileAlready)); + return getString(R.string.FileAlready); } } catch (ParserConfigurationException e) { @@ -730,7 +730,7 @@ private String saveProject() { public void onBackPressed() { super.onBackPressed(); if (saveDraft() != null) - Toast.makeText(getApplicationContext(), "Saved in Draft!", Toast.LENGTH_SHORT).show(); + Toast.makeText(getApplicationContext(), R.string.Draft_Saved, Toast.LENGTH_SHORT).show(); } @@ -776,7 +776,7 @@ private String saveDraft() { Element dataElement = doc.createElement("data"); rootElement.appendChild(dataElement); if (selectedTemplate.getItems(doc).size() == 0) { - Toast.makeText(this, "Unable to perform action: No Data", Toast.LENGTH_SHORT).show(); + Toast.makeText(this,R.string.NoData, Toast.LENGTH_SHORT).show(); return null; } for (Element item : selectedTemplate.getItems(doc)) { @@ -827,12 +827,12 @@ private String saveDraft() { private void startSimulator() { String message = saveProject(); if (message == null || message.equals("")) { - Toast.makeText(this, "Build unsuccessful", Toast.LENGTH_SHORT).show(); + Toast.makeText(this, R.string.Build_Unsuccessful, Toast.LENGTH_SHORT).show(); return; } - else if("File already exists".equals(message)) + else if(getString(R.string.FileAlready).equals(message)) { - titleEditText.setError("Template Already exists"); + titleEditText.setError(getString(R.string.TemplateAlready)); return; } Intent simulatorIntent = new Intent(getApplicationContext(), Simulator.class); diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/comprehensiontemplate/fragment/LastFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/comprehensiontemplate/fragment/LastFragment.java index fc564358..3bd2057c 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/comprehensiontemplate/fragment/LastFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/comprehensiontemplate/fragment/LastFragment.java @@ -62,7 +62,7 @@ public boolean onMenuItemClick(MenuItem menuItem) { new AlertDialog.Builder(getActivity()); builder.setTitle(String.format("%1$s", getString(R.string.comprehension_about_us))); builder.setMessage(getResources().getText(R.string.comprehension_about_text)); - builder.setPositiveButton("OK", null); + builder.setPositiveButton(R.string.quiz_ok, null); AlertDialog welcomeAlert = builder.create(); welcomeAlert.show(); assert welcomeAlert.findViewById(android.R.id.message) != null; @@ -79,9 +79,9 @@ public boolean onMenuItemClick(MenuItem menuItem) { db.close(); - ((TextView) rootView.findViewById(R.id.correct)).setText(String.format(Locale.getDefault(), "Total Correct : %1$d", stat[0])); - ((TextView) rootView.findViewById(R.id.wrong)).setText(String.format(Locale.getDefault(), "Total Wrong : %1$d", stat[1])); - ((TextView) rootView.findViewById(R.id.un_answered)).setText(String.format(Locale.getDefault(), "Total Unanswered : %1$d", stat[2])); + ((TextView) rootView.findViewById(R.id.correct)).setText(String.format(Locale.getDefault(), getString(R.string.correct_total)+ stat[0])); + ((TextView) rootView.findViewById(R.id.wrong)).setText(String.format(Locale.getDefault(), getString(R.string.total_wrong)+ stat[1])); + ((TextView) rootView.findViewById(R.id.un_answered)).setText(String.format(Locale.getDefault(), getString(R.string.total_unanswered)+ stat[2])); rootView.findViewById(R.id.restart).setOnClickListener(new View.OnClickListener() { @Override diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/comprehensiontemplate/fragment/MainFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/comprehensiontemplate/fragment/MainFragment.java index 1e2ada4a..f842fd7d 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/comprehensiontemplate/fragment/MainFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/comprehensiontemplate/fragment/MainFragment.java @@ -63,7 +63,7 @@ public boolean onMenuItemClick(MenuItem menuItem) { new AlertDialog.Builder(getActivity()); builder.setTitle(String.format("%1$s", getString(R.string.comprehension_about_us))); builder.setMessage(getResources().getText(R.string.comprehension_about_text)); - builder.setPositiveButton("OK", null); + builder.setPositiveButton(R.string.quiz_ok, null); AlertDialog welcomeAlert = builder.create(); welcomeAlert.show(); assert welcomeAlert.findViewById(android.R.id.message) != null; diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/comprehensiontemplate/fragment/QuestionFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/comprehensiontemplate/fragment/QuestionFragment.java index da34a9e9..31f5c862 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/comprehensiontemplate/fragment/QuestionFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/comprehensiontemplate/fragment/QuestionFragment.java @@ -63,7 +63,7 @@ public boolean onMenuItemClick(MenuItem menuItem) { new AlertDialog.Builder(getActivity()); builder.setTitle(String.format("%1$s", getString(R.string.comprehension_about_us))); builder.setMessage(getResources().getText(R.string.comprehension_about_text)); - builder.setPositiveButton("OK", null); + builder.setPositiveButton(R.string.quiz_ok, null); AlertDialog welcomeAlert = builder.create(); welcomeAlert.show(); assert welcomeAlert.findViewById(android.R.id.message) != null; @@ -152,7 +152,7 @@ public boolean onMenuItemClick(MenuItem item) { }); } - ((TextView) rootView.findViewById(R.id.question_title)).setText(String.format(Locale.getDefault(), "Question No : %1$s", questionId)); + ((TextView) rootView.findViewById(R.id.question_title)).setText(String.format(Locale.getDefault(), getString(R.string.questionNo)+ questionId)); ((TextView) rootView.findViewById(R.id.question)).setText(question); if (option_1 != null) { rootView.findViewById(R.id.radioButton1).setVisibility(View.VISIBLE); diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/dictationtemplate/fragment/DetailActivityFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/dictationtemplate/fragment/DetailActivityFragment.java index 9f6aa472..cb6d0677 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/dictationtemplate/fragment/DetailActivityFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/dictationtemplate/fragment/DetailActivityFragment.java @@ -94,7 +94,7 @@ public boolean onMenuItemClick(MenuItem menuItem) { new AlertDialog.Builder(getActivity()); builder.setTitle(String.format("%1$s", getString(R.string.comprehension_about_us))); builder.setMessage(getResources().getText(R.string.about_text_video)); - builder.setPositiveButton("OK", null); + builder.setPositiveButton(R.string.quiz_ok, null); AlertDialog welcomeAlert = builder.create(); welcomeAlert.show(); assert welcomeAlert.findViewById(android.R.id.message) != null; @@ -153,7 +153,7 @@ public void onLoadFinished(Loader loader, final Cursor data) { public void onClick(View v) { progress = new ProgressDialog(getActivity()); progress.setCancelable(false); - progress.setMessage("Loading TTS Engine..."); + progress.setMessage(getString(R.string.TTSLoading)); progress.show(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { @@ -226,10 +226,10 @@ public void onInit(int status) { int result = tts.setLanguage(Locale.US); if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) { - Toast.makeText(getContext(), "US English is not supported. Playing in device's default installed language.", Toast.LENGTH_SHORT).show(); + Toast.makeText(getContext(), R.string.USEnglishNotSupported, Toast.LENGTH_SHORT).show(); } } else { - Toast.makeText(getContext(), "Initialization Failed!", Toast.LENGTH_SHORT).show(); + Toast.makeText(getContext(), R.string.TTSFAIL, Toast.LENGTH_SHORT).show(); } } }); diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/dictationtemplate/fragment/MainActivityFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/dictationtemplate/fragment/MainActivityFragment.java index 15526beb..dafebf0e 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/dictationtemplate/fragment/MainActivityFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/dictationtemplate/fragment/MainActivityFragment.java @@ -83,7 +83,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, rootView = inflater.inflate(R.layout.fragment_main_dict, container, false); Toolbar toolbar = (Toolbar) rootView.findViewById(R.id.card_toolbar); - toolbar.setTitle("List of Passages :"); + toolbar.setTitle(R.string.ListPassage); Toolbar maintoolbar = (Toolbar) rootView.findViewById(R.id.toolbar_main); final String result[] = DataUtils.readTitleAuthor(); @@ -98,7 +98,7 @@ public boolean onMenuItemClick(MenuItem menuItem) { new AlertDialog.Builder(getActivity()); builder.setTitle(String.format("%1$s", getString(R.string.about_us_dict))); builder.setMessage(getResources().getText(R.string.about_text_dict)); - builder.setPositiveButton("OK", null); + builder.setPositiveButton(R.string.quiz_ok, null); AlertDialog welcomeAlert = builder.create(); welcomeAlert.show(); assert welcomeAlert.findViewById(android.R.id.message) != null; diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/dictationtemplate/fragment/ResultActivityFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/dictationtemplate/fragment/ResultActivityFragment.java index 087eef1e..cca50d5b 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/dictationtemplate/fragment/ResultActivityFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/dictationtemplate/fragment/ResultActivityFragment.java @@ -90,7 +90,7 @@ public boolean onMenuItemClick(MenuItem menuItem) { new AlertDialog.Builder(getActivity()); builder.setTitle(String.format("%1$s", getString(R.string.comprehension_about_us))); builder.setMessage(getResources().getText(R.string.about_text_video)); - builder.setPositiveButton("OK", null); + builder.setPositiveButton(R.string.quiz_ok, null); AlertDialog welcomeAlert = builder.create(); welcomeAlert.show(); assert welcomeAlert.findViewById(android.R.id.message) != null; @@ -150,7 +150,7 @@ public void onLoadFinished(Loader loader, final Cursor data) { String result[] = obj.diff_prettyHtml(llDiffs); int numTWords = passage.split(" ").length; - ((TextView) rootView.findViewById(R.id.score)).setText(String.format(Locale.ENGLISH, "SCORE : %s / %d", result[1], numTWords)); + ((TextView) rootView.findViewById(R.id.score)).setText(String.format(Locale.ENGLISH, R.string.score+result[1]+"/"+numTWords)); ((TextView) rootView.findViewById(R.id.checked_text)).setText(Html.fromHtml(result[0])); diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/flashcardtemplate/fragment/LastFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/flashcardtemplate/fragment/LastFragment.java index ed5c30ec..79f8d7b4 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/flashcardtemplate/fragment/LastFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/flashcardtemplate/fragment/LastFragment.java @@ -48,7 +48,7 @@ public boolean onMenuItemClick(MenuItem menuItem) { new AlertDialog.Builder(getActivity()); builder.setTitle(String.format("%1$s", getString(R.string.comprehension_about_us))); builder.setMessage(getResources().getText(R.string.comprehension_about_text)); - builder.setPositiveButton("OK", null); + builder.setPositiveButton(R.string.ok, null); AlertDialog welcomeAlert = builder.create(); welcomeAlert.show(); assert welcomeAlert.findViewById(android.R.id.message) != null; diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/flashcardtemplate/fragment/MainFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/flashcardtemplate/fragment/MainFragment.java index a42819a6..9ce72667 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/flashcardtemplate/fragment/MainFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/flashcardtemplate/fragment/MainFragment.java @@ -78,7 +78,7 @@ public boolean onMenuItemClick(MenuItem menuItem) { new AlertDialog.Builder(getActivity()); builder.setTitle(String.format("%1$s", getString(R.string.comprehension_about_us))); builder.setMessage(getResources().getText(R.string.comprehension_about_text)); - builder.setPositiveButton("OK", null); + builder.setPositiveButton(R.string.ok, null); AlertDialog welcomeAlert = builder.create(); welcomeAlert.show(); assert welcomeAlert.findViewById(android.R.id.message) != null; @@ -152,11 +152,11 @@ public boolean onMenuItemClick(MenuItem item) { String base64 = flash_cursor.getString(Constants.COL_BASE64); assert rootView.findViewById(R.id.intro_number) != null; - ((TextView) rootView.findViewById(R.id.intro_number)).setText(String.format(Locale.ENGLISH, "Card #%d of %d", Integer.parseInt(FlashId), numFlash)); + ((TextView) rootView.findViewById(R.id.intro_number)).setText(String.format(Locale.ENGLISH, getString(R.string.card)+Integer.parseInt(FlashId)+getString(R.string.of_score)+numFlash)); assert rootView.findViewById(R.id.question) != null; ((TextView) rootView.findViewById(R.id.question)).setText(question); assert rootView.findViewById(R.id.hint) != null; - ((TextView) rootView.findViewById(R.id.hint)).setText(String.format(Locale.ENGLISH, "Hint : %s", hint)); + ((TextView) rootView.findViewById(R.id.hint)).setText(String.format(Locale.ENGLISH, getString(R.string.hint)+hint)); Button prv = (Button) rootView.findViewById(R.id.previous); Button flip = (Button) rootView.findViewById(R.id.flip); diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/fragment/DraftsFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/fragment/DraftsFragment.java index 513edb81..56f85f3c 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/fragment/DraftsFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/fragment/DraftsFragment.java @@ -152,7 +152,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) return; } } - Toast.makeText(getActivity(), "Invalid project file", Toast.LENGTH_SHORT).show(); + Toast.makeText(getActivity(), R.string.InvalidProjectFile, Toast.LENGTH_SHORT).show(); } private void setAdapter(DraftProjectAdapter adapter) { @@ -368,11 +368,11 @@ private void deleteItems() { } if(deleted) if(selectedPositions.size()==1) - Toast.makeText(activity,"Project Successfully Deleted", Toast.LENGTH_SHORT).show(); + Toast.makeText(activity, R.string.successDelete1, Toast.LENGTH_SHORT).show(); else - Toast.makeText(activity,selectedPositions.size()+" Projects Successfully Deleted", Toast.LENGTH_SHORT).show(); + Toast.makeText(activity,selectedPositions.size()+getString(R.string.sucessdelete2), Toast.LENGTH_SHORT).show(); else - Toast.makeText(activity, "Project Deletion Failed!", Toast.LENGTH_SHORT).show(); + Toast.makeText(activity, R.string.deletefail, Toast.LENGTH_SHORT).show(); } /** diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/fragment/LoadApkFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/fragment/LoadApkFragment.java index a47d512b..dc242633 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/fragment/LoadApkFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/fragment/LoadApkFragment.java @@ -349,7 +349,7 @@ public void onClick(View v) { actionBar.setCustomView(R.layout.search_bar); actionBar.setDisplayShowTitleEnabled(false); editSearch = (EditText) actionBar.getCustomView().findViewById(R.id.editSearch); - editSearch.setHint("Enter Apk name"); + editSearch.setHint(R.string.EnterAPK); editSearch.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { @@ -454,11 +454,11 @@ private void deleteItems() { } if(deleted) if(selectedPositions.size()==1) - Toast.makeText(activity,"Project Successfully Deleted", Toast.LENGTH_SHORT).show(); + Toast.makeText(activity,R.string.successDelete1, Toast.LENGTH_SHORT).show(); else - Toast.makeText(activity,selectedPositions.size()+" Projects Successfully Deleted", Toast.LENGTH_SHORT).show(); + Toast.makeText(activity,selectedPositions.size()+R.string.sucessdelete2, Toast.LENGTH_SHORT).show(); else - Toast.makeText(activity, "Project Deletion Failed!", Toast.LENGTH_SHORT).show(); + Toast.makeText(activity, R.string.deletefail, Toast.LENGTH_SHORT).show(); } /** diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/fragment/LoadProjectFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/fragment/LoadProjectFragment.java index 6a295fe8..f7415a32 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/fragment/LoadProjectFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/fragment/LoadProjectFragment.java @@ -199,7 +199,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) return; } } - Toast.makeText(getActivity(), "Invalid project file", Toast.LENGTH_SHORT).show(); + Toast.makeText(getActivity(), R.string.InvalidProjectFile, Toast.LENGTH_SHORT).show(); } private void setAdapter(SavedProjectAdapter adapter) { @@ -388,7 +388,7 @@ public void onClick(View v) { actionBar.setCustomView(R.layout.search_bar); actionBar.setDisplayShowTitleEnabled(false); editSearch = (EditText) actionBar.getCustomView().findViewById(R.id.editSearch); - editSearch.setHint("Enter name of Project"); + editSearch.setHint(R.string.EnterProject); editSearch.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { @@ -496,11 +496,11 @@ private void deleteItems() { } if(deleted) if(selectedPositions.size()==1) - Toast.makeText(activity,"Project Successfully Deleted", Toast.LENGTH_SHORT).show(); + Toast.makeText(activity,R.string.successDelete1, Toast.LENGTH_SHORT).show(); else - Toast.makeText(activity,selectedPositions.size()+" Projects Successfully Deleted", Toast.LENGTH_SHORT).show(); + Toast.makeText(activity,selectedPositions.size()+R.string.sucessdelete2, Toast.LENGTH_SHORT).show(); else - Toast.makeText(activity, "Project Deletion Failed!", Toast.LENGTH_SHORT).show(); + Toast.makeText(activity, R.string.deletefail, Toast.LENGTH_SHORT).show(); } /** diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/fragment/SettingsFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/fragment/SettingsFragment.java index 2e61f7b5..b42b64b3 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/fragment/SettingsFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/fragment/SettingsFragment.java @@ -272,8 +272,7 @@ private class AsyncTaskRunner extends AsyncTask { @Override protected void onPreExecute() { progressDialog = new ProgressDialog(getActivity()); - progressDialog.setTitle("Deleting..."); - progressDialog.setMessage("Deleting Temporary file"); + progressDialog.setMessage(getString(R.string.deleting_temp_files)); progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); progressDialog.setCancelable(false); progressDialog.show(); @@ -290,9 +289,9 @@ protected Float doInBackground(String... params) { protected void onPostExecute(Float size) { progressDialog.dismiss(); if (size != 0) { - Toast.makeText(getActivity(), "Deleted " + size + " MB.", Toast.LENGTH_SHORT).show(); + Toast.makeText(getActivity(), getString(R.string.deleted) + size + getString(R.string.MB), Toast.LENGTH_SHORT).show(); } else { - Toast.makeText(getActivity(), "No Temp Files Found!", Toast.LENGTH_SHORT).show(); + Toast.makeText(getActivity(), R.string.No_temp_files, Toast.LENGTH_SHORT).show(); } } } diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/infotemplate/fragment/DetailActivityFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/infotemplate/fragment/DetailActivityFragment.java index 65235096..93967dbf 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/infotemplate/fragment/DetailActivityFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/infotemplate/fragment/DetailActivityFragment.java @@ -82,7 +82,7 @@ public boolean onMenuItemClick(MenuItem menuItem) { new AlertDialog.Builder(getActivity()); builder.setTitle(String.format("%1$s", getString(R.string.comprehension_about_us))); builder.setMessage(getResources().getText(R.string.about_text_video)); - builder.setPositiveButton("OK", null); + builder.setPositiveButton(getString(R.string.ok), null); AlertDialog welcomeAlert = builder.create(); welcomeAlert.show(); assert welcomeAlert.findViewById(android.R.id.message) != null; diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/infotemplate/fragment/MainActivityFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/infotemplate/fragment/MainActivityFragment.java index 084d1fd0..8e79a649 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/infotemplate/fragment/MainActivityFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/infotemplate/fragment/MainActivityFragment.java @@ -94,7 +94,7 @@ public boolean onMenuItemClick(MenuItem menuItem) { new AlertDialog.Builder(getActivity()); builder.setTitle(String.format("%1$s", getString(R.string.comprehension_about_us))); builder.setMessage(getResources().getText(R.string.about_text_info)); - builder.setPositiveButton("OK", null); + builder.setPositiveButton(getString(R.string.ok), null); AlertDialog welcomeAlert = builder.create(); welcomeAlert.show(); assert welcomeAlert.findViewById(android.R.id.message) != null; diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/learnspelling/fragment/LastFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/learnspelling/fragment/LastFragment.java index 6d4445c2..540659fa 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/learnspelling/fragment/LastFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/learnspelling/fragment/LastFragment.java @@ -57,7 +57,7 @@ public boolean onMenuItemClick(MenuItem menuItem) { new AlertDialog.Builder(getActivity()); builder.setTitle(String.format("%1$s", getString(R.string.comprehension_about_us))); builder.setMessage(getResources().getText(R.string.comprehension_about_text)); - builder.setPositiveButton("OK", null); + builder.setPositiveButton(getString(R.string.ok), null); AlertDialog welcomeAlert = builder.create(); welcomeAlert.show(); assert welcomeAlert.findViewById(android.R.id.message) != null; @@ -77,11 +77,11 @@ public boolean onMenuItemClick(MenuItem menuItem) { int stat[] = db.getStatistics(); assert rootView.findViewById(R.id.correct) != null; - ((TextView) rootView.findViewById(R.id.correct)).setText(String.format(Locale.getDefault(), "Total Correct : %1$d", stat[0])); + ((TextView) rootView.findViewById(R.id.correct)).setText(String.format(Locale.getDefault(), getString(R.string.correct_total)+ stat[0])); assert rootView.findViewById(R.id.wrong) != null; - ((TextView) rootView.findViewById(R.id.wrong)).setText(String.format(Locale.getDefault(), "Total Wrong : %1$d", stat[1])); + ((TextView) rootView.findViewById(R.id.wrong)).setText(String.format(Locale.getDefault(), getString(R.string.total_wrong)+ stat[1])); assert rootView.findViewById(R.id.un_answered) != null; - ((TextView) rootView.findViewById(R.id.un_answered)).setText(String.format(Locale.getDefault(), "Total Unanswered : %1$d", stat[2])); + ((TextView) rootView.findViewById(R.id.un_answered)).setText(String.format(Locale.getDefault(), getString(R.string.total_unanswered)+stat[2])); rootView.findViewById(R.id.restart).setOnClickListener(new View.OnClickListener() { @Override diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/learnspelling/fragment/MainFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/learnspelling/fragment/MainFragment.java index c84d4d4b..29ab8f36 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/learnspelling/fragment/MainFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/learnspelling/fragment/MainFragment.java @@ -83,7 +83,7 @@ public boolean onMenuItemClick(MenuItem menuItem) { new AlertDialog.Builder(getActivity()); builder.setTitle(String.format("%1$s", getString(R.string.comprehension_about_us))); builder.setMessage(getResources().getText(R.string.comprehension_about_text)); - builder.setPositiveButton("OK", null); + builder.setPositiveButton(getString(R.string.ok), null); AlertDialog welcomeAlert = builder.create(); welcomeAlert.show(); assert welcomeAlert.findViewById(android.R.id.message) != null; @@ -156,7 +156,7 @@ public boolean onMenuItemClick(MenuItem item) { mBtn_Spell.setEnabled(false); mBtn_Skip.setEnabled(false); - mTv_WordNumber.setText(String.format(Locale.ENGLISH, "Word #%d of %d", Integer.parseInt(spellId), numQues)); + mTv_WordNumber.setText(String.format(Locale.ENGLISH, getString(R.string.R_string_word)+Integer.parseInt(spellId)+getString(R.string.of_score)+numQues)); Cursor spell_cursor = db.getSpellingCursorById(Integer.parseInt(spellId)); spell_cursor.moveToFirst(); @@ -210,7 +210,7 @@ public void onClick(View v) { progress = new ProgressDialog(mContext); progress.setCancelable(false); - progress.setMessage("Loading TTS Engine..."); + progress.setMessage(getString(R.string.TTSLoading)); progress.show(); @@ -265,7 +265,7 @@ public void onClick(View v) { private void submit(String spell) { String input = mEt_Spelling.getText().toString().trim(); if (input.length() == 0) { - Toast.makeText(mContext, "Please enter the spelling", + Toast.makeText(mContext, R.string.EnterSpelling, Toast.LENGTH_SHORT).show(); } else { @@ -319,10 +319,10 @@ public void onInit(int status) { int result = tts.setLanguage(Locale.US); if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) { - Toast.makeText(mContext, "US English is not supported. Playing in device's default installed language.", Toast.LENGTH_SHORT).show(); + Toast.makeText(mContext, R.string.USEnglishNotSupported, Toast.LENGTH_SHORT).show(); } } else { - Toast.makeText(mContext, "Initialization Failed!", Toast.LENGTH_SHORT).show(); + Toast.makeText(mContext, R.string.TTSFAIL, Toast.LENGTH_SHORT).show(); } } }); diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/learnspelling/fragment/ResponseFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/learnspelling/fragment/ResponseFragment.java index 7f6b5b6d..e15323ec 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/learnspelling/fragment/ResponseFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/learnspelling/fragment/ResponseFragment.java @@ -67,7 +67,7 @@ public boolean onMenuItemClick(MenuItem menuItem) { new AlertDialog.Builder(getActivity()); builder.setTitle(String.format("%1$s", getString(R.string.comprehension_about_us))); builder.setMessage(getResources().getText(R.string.comprehension_about_text)); - builder.setPositiveButton("OK", null); + builder.setPositiveButton(getString(R.string.ok), null); AlertDialog welcomeAlert = builder.create(); welcomeAlert.show(); assert welcomeAlert.findViewById(android.R.id.message) != null; @@ -142,16 +142,16 @@ public boolean onMenuItemClick(MenuItem item) { TextView mTv_WordNumber = (TextView) rootView.findViewById(R.id.intro_number); - mTv_WordNumber.setText(String.format(Locale.ENGLISH, "Word #%d of %d", Integer.parseInt(spellId), numQues)); + mTv_WordNumber.setText(String.format(Locale.ENGLISH, getString(R.string.R_string_word)+Integer.parseInt(spellId)+getString(R.string.of_score)+numQues)); String message; String word_text_view; if (word.trim().equalsIgnoreCase(answered)) { - message = "Great! You got it right."; + message = getString(R.string.RightAnswer); word_text_view = "Correct Spell:  " + word + ""; } else { - message = "Oops! You got it wrong."; - word_text_view = "Correct Spell:  " + word + "
You entered:  " + answered + ""; + message = getString(R.string.WrongAnswer); + word_text_view = "Correct Spell:" + word + "
You entered:  " + answered + ""; } assert rootView.findViewById(R.id.intro_response) != null; diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/matchtemplate/fragment/DetailFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/matchtemplate/fragment/DetailFragment.java index 70310c3b..9ecc24c0 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/matchtemplate/fragment/DetailFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/matchtemplate/fragment/DetailFragment.java @@ -127,7 +127,7 @@ public boolean onMenuItemClick(MenuItem menuItem) { new AlertDialog.Builder(getActivity()); builder.setTitle(String.format("%1$s", getString(R.string.comprehension_about_us))); builder.setMessage(getResources().getText(R.string.comprehension_about_text)); - builder.setPositiveButton("OK", null); + builder.setPositiveButton(getString(R.string.ok), null); AlertDialog welcomeAlert = builder.create(); welcomeAlert.show(); assert welcomeAlert.findViewById(android.R.id.message) != null; @@ -167,7 +167,7 @@ public boolean onMenuItemClick(MenuItem menuItem) { listViewB.addHeaderView(header_B); listViewB.addFooterView(footer_B); - ((TextView) rootView.findViewById(R.id.score)).setText(String.format(Locale.ENGLISH, "Score : %d of %d", countScore, matchListA.size())); + ((TextView) rootView.findViewById(R.id.score)).setText(String.format(Locale.ENGLISH, getString(R.string.score)+countScore+getString(R.string.of_score)+matchListA.size())); if (savedInstanceState != null && savedInstanceState.containsKey(SELECTED_KEY_A) && savedInstanceState.containsKey(SELECTED_KEY_B)) { mPositionA = savedInstanceState.getInt(SELECTED_KEY_A); diff --git a/source-code/app/src/main/java/org/buildmlearn/toolkit/matchtemplate/fragment/MainFragment.java b/source-code/app/src/main/java/org/buildmlearn/toolkit/matchtemplate/fragment/MainFragment.java index 5362768a..6b66f16d 100644 --- a/source-code/app/src/main/java/org/buildmlearn/toolkit/matchtemplate/fragment/MainFragment.java +++ b/source-code/app/src/main/java/org/buildmlearn/toolkit/matchtemplate/fragment/MainFragment.java @@ -144,7 +144,7 @@ public boolean onMenuItemClick(MenuItem menuItem) { new AlertDialog.Builder(getActivity()); builder.setTitle(String.format("%1$s", getString(R.string.comprehension_about_us))); builder.setMessage(getResources().getText(R.string.comprehension_about_text)); - builder.setPositiveButton("OK", null); + builder.setPositiveButton(getString(R.string.ok), null); AlertDialog welcomeAlert = builder.create(); welcomeAlert.show(); assert welcomeAlert.findViewById(android.R.id.message) != null; diff --git a/source-code/app/src/main/res/values/strings.xml b/source-code/app/src/main/res/values/strings.xml index e69b290c..56302d5f 100644 --- a/source-code/app/src/main/res/values/strings.xml +++ b/source-code/app/src/main/res/values/strings.xml @@ -418,5 +418,46 @@ Title must start with alphanumeric Enter valid name Two or more options are same. + Score : + " of " + OK + "Total Correct : " + "Total Wrong : " + "Total Unanswered : " + "Word " + Loading TTS Engineā€¦ + Please enter the spelling + US English is not supported. Playing in device\'s default installed language. + Initialization Failed! + Great! You got it right. + Oops! You got it wrong. + Invalid project file + Project Successfully Deleted + " Projects Successfully Deleted" + Project Deletion Failed! + Enter Apk name + Enter name of Project + Deleting Temporary files. + No Temp Files Found! + "Deleted " + " MB." + "Card " + "Hint : " + List of Passages : + "Question No : " + "Version: " + Version: 1.0 + Tap back once more to exit. + Build unsuccessful + Invalid template ID, closing Template Editor activity + File already exists + APK generated + "Apk file saved at " + Author name is required + Unable to perform action: No Data + Unable to perform action: Add Meta Details + Project Successfully Saved! + Saved in Draft! + Template Already exists