From 6d1357e15d2eaecece3e91ae0cffd80f89f6ea54 Mon Sep 17 00:00:00 2001 From: serso Date: Fri, 26 Feb 2016 23:28:29 +0100 Subject: [PATCH] Translations --- .../android/calculator/plot/BasePlotTest.java | 2 +- .../android/calculator/DisplayFragment.java | 18 +++------- .../converter/ConverterFragment.java | 32 ++++------------- .../floating/FloatingCalculatorActivity.java | 2 +- .../functions/BaseFunctionFragment.java | 36 ++++--------------- .../functions/EditFunctionFragment.java | 6 ++-- .../functions/FunctionsFragment.java | 26 +++++--------- .../history/BaseHistoryFragment.java | 8 ++--- .../history/EditHistoryFragment.java | 2 +- .../calculator/history/HistoryActivity.java | 13 +++---- .../plot/PlotFunctionsFragment.java | 27 ++++++-------- .../variables/EditVariableFragment.java | 32 ++++++----------- .../variables/VariablesFragment.java | 12 +++---- .../fragment_function_edit_base_controls.xml | 4 +-- ...g_functions.xml => fragment_functions.xml} | 0 ...on.xml => fragment_functions_function.xml} | 0 app/src/main/res/values-ar/text_imported.xml | 8 ++++- app/src/main/res/values-cs/text_imported.xml | 8 ++++- app/src/main/res/values-de/text_imported.xml | 8 ++++- app/src/main/res/values-es/text_imported.xml | 8 ++++- app/src/main/res/values-fi/text_imported.xml | 8 ++++- app/src/main/res/values-fr/text_imported.xml | 8 ++++- app/src/main/res/values-it/text_imported.xml | 8 ++++- app/src/main/res/values-ja/text_imported.xml | 8 ++++- app/src/main/res/values-nl/text_imported.xml | 8 ++++- app/src/main/res/values-pl/text_imported.xml | 8 ++++- .../main/res/values-pt-rBR/text_imported.xml | 8 ++++- .../main/res/values-pt-rPT/text_imported.xml | 8 ++++- app/src/main/res/values-ru/text_imported.xml | 8 ++++- app/src/main/res/values-tr/text_imported.xml | 8 ++++- app/src/main/res/values-vi/text_imported.xml | 8 ++++- .../main/res/values-zh-rCN/text_imported.xml | 8 ++++- .../main/res/values-zh-rTW/text_imported.xml | 8 ++++- app/src/main/res/values/text_imported.xml | 8 ++++- .../main/res/values/text_non_translatable.xml | 1 + .../android/translations/Android.java | 24 ++++++++++--- 36 files changed, 215 insertions(+), 174 deletions(-) rename app/src/main/res/layout/{dialog_functions.xml => fragment_functions.xml} (100%) rename app/src/main/res/layout/{dialog_functions_function.xml => fragment_functions_function.xml} (100%) diff --git a/app/src/androidTest/java/org/solovyev/android/calculator/plot/BasePlotTest.java b/app/src/androidTest/java/org/solovyev/android/calculator/plot/BasePlotTest.java index 08da0fec..53e5d432 100644 --- a/app/src/androidTest/java/org/solovyev/android/calculator/plot/BasePlotTest.java +++ b/app/src/androidTest/java/org/solovyev/android/calculator/plot/BasePlotTest.java @@ -43,7 +43,7 @@ public class BasePlotTest { } onView(withId(R.id.function_body)).perform(typeText(function.getBody())); - onView(withText(R.string.ok)).perform(click()); + onView(withText(R.string.cpp_done)).perform(click()); } protected final void openFunctionEditor() { diff --git a/app/src/main/java/org/solovyev/android/calculator/DisplayFragment.java b/app/src/main/java/org/solovyev/android/calculator/DisplayFragment.java index ac0beb33..e6f5c752 100644 --- a/app/src/main/java/org/solovyev/android/calculator/DisplayFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/DisplayFragment.java @@ -26,27 +26,19 @@ import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; -import android.support.annotation.LayoutRes; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.StringRes; import android.support.v7.app.AlertDialog; -import android.view.ContextMenu; -import android.view.LayoutInflater; -import android.view.MenuItem; -import android.view.View; -import android.view.ViewGroup; +import android.view.*; import android.widget.TextView; - -import com.squareup.otto.Bus; - -import org.solovyev.android.calculator.converter.ConverterFragment; -import org.solovyev.android.calculator.jscl.JsclOperation; - import butterknife.Bind; import butterknife.ButterKnife; +import com.squareup.otto.Bus; import jscl.NumeralBase; import jscl.math.Generic; +import org.solovyev.android.calculator.converter.ConverterFragment; +import org.solovyev.android.calculator.jscl.JsclOperation; import javax.annotation.Nonnull; import javax.inject.Inject; @@ -182,7 +174,7 @@ public class DisplayFragment extends BaseFragment implements View.OnClickListene final AlertDialog.Builder builder = new AlertDialog.Builder(context, App.getTheme().alertDialogTheme) - .setPositiveButton(R.string.c_cancel, null) + .setPositiveButton(R.string.cpp_cancel, null) .setView(errorMessageView); builder.create().show(); diff --git a/app/src/main/java/org/solovyev/android/calculator/converter/ConverterFragment.java b/app/src/main/java/org/solovyev/android/calculator/converter/ConverterFragment.java index 4f030599..b01df768 100644 --- a/app/src/main/java/org/solovyev/android/calculator/converter/ConverterFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/converter/ConverterFragment.java @@ -17,33 +17,10 @@ import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.View; import android.view.inputmethod.EditorInfo; -import android.widget.AdapterView; -import android.widget.ArrayAdapter; -import android.widget.EditText; -import android.widget.ImageButton; -import android.widget.Spinner; -import android.widget.TextView; -import android.widget.Toast; - -import org.solovyev.android.calculator.App; -import org.solovyev.android.calculator.AppComponent; -import org.solovyev.android.calculator.BaseDialogFragment; -import org.solovyev.android.calculator.Clipboard; -import org.solovyev.android.calculator.Editor; -import org.solovyev.android.calculator.R; - +import android.widget.*; import butterknife.Bind; import butterknife.ButterKnife; - -import java.text.DecimalFormat; -import java.text.ParseException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import org.solovyev.android.calculator.*; import javax.annotation.Nonnull; import javax.inject.Inject; @@ -51,6 +28,9 @@ import javax.measure.unit.Dimension; import javax.measure.unit.NonSI; import javax.measure.unit.SI; import javax.measure.unit.Unit; +import java.text.DecimalFormat; +import java.text.ParseException; +import java.util.*; public class ConverterFragment extends BaseDialogFragment implements AdapterView.OnItemSelectedListener, View.OnFocusChangeListener, TextView.OnEditorActionListener, View.OnClickListener, TextWatcher { @@ -143,7 +123,7 @@ public class ConverterFragment extends BaseDialogFragment @Override protected void onPrepareDialog(@NonNull AlertDialog.Builder builder) { builder.setPositiveButton(R.string.c_use, null); - builder.setNegativeButton(R.string.c_cancel, null); + builder.setNegativeButton(R.string.cpp_cancel, null); builder.setNeutralButton(R.string.c_copy, null); } diff --git a/app/src/main/java/org/solovyev/android/calculator/floating/FloatingCalculatorActivity.java b/app/src/main/java/org/solovyev/android/calculator/floating/FloatingCalculatorActivity.java index 11edd71f..488d7beb 100644 --- a/app/src/main/java/org/solovyev/android/calculator/floating/FloatingCalculatorActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/floating/FloatingCalculatorActivity.java @@ -47,7 +47,7 @@ public class FloatingCalculatorActivity extends AppCompatActivity { final String permission = getString(R.string.cpp_permission_overlay); builder.setMessage(getString(R.string.cpp_missing_permission_msg, permission)); builder.setTitle(R.string.cpp_missing_permission_title); - builder.setPositiveButton(R.string.ok, null); + builder.setPositiveButton(android.R.string.ok, null); } @Override diff --git a/app/src/main/java/org/solovyev/android/calculator/functions/BaseFunctionFragment.java b/app/src/main/java/org/solovyev/android/calculator/functions/BaseFunctionFragment.java index 10a542d9..b1775551 100644 --- a/app/src/main/java/org/solovyev/android/calculator/functions/BaseFunctionFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/functions/BaseFunctionFragment.java @@ -33,42 +33,20 @@ import android.support.design.widget.TextInputLayout; import android.support.v7.app.AlertDialog; import android.text.Editable; import android.text.TextUtils; -import android.view.ContextMenu; -import android.view.KeyEvent; -import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.view.ViewGroup; -import android.view.ViewParent; +import android.view.*; import android.view.inputmethod.InputMethodManager; import android.widget.EditText; - -import org.solovyev.android.calculator.AppComponent; -import org.solovyev.android.calculator.BaseDialogFragment; -import org.solovyev.android.calculator.Calculator; -import org.solovyev.android.calculator.Engine; -import org.solovyev.android.calculator.FloatingCalculatorKeyboard; -import org.solovyev.android.calculator.Keyboard; -import org.solovyev.android.calculator.ParseException; -import org.solovyev.android.calculator.R; -import org.solovyev.android.calculator.VariablesRegistry; +import butterknife.Bind; +import butterknife.ButterKnife; +import org.solovyev.android.calculator.*; import org.solovyev.android.calculator.keyboard.FloatingKeyboardWindow; import org.solovyev.android.calculator.view.EditTextCompat; import org.solovyev.common.math.MathRegistry; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.inject.Inject; - -import butterknife.Bind; -import butterknife.ButterKnife; +import java.util.*; import static org.solovyev.android.calculator.functions.CppFunction.NO_ID; @@ -132,8 +110,8 @@ public abstract class BaseFunctionFragment extends BaseDialogFragment implements @Override protected void onPrepareDialog(@NonNull AlertDialog.Builder builder) { - builder.setNegativeButton(R.string.c_cancel, null); - builder.setPositiveButton(R.string.ok, null); + builder.setNegativeButton(R.string.cpp_cancel, null); + builder.setPositiveButton(R.string.cpp_done, null); builder.setTitle(isNewFunction() ? R.string.function_create_function : R.string.function_edit_function); } diff --git a/app/src/main/java/org/solovyev/android/calculator/functions/EditFunctionFragment.java b/app/src/main/java/org/solovyev/android/calculator/functions/EditFunctionFragment.java index 9f1ae9fe..f6f82b07 100644 --- a/app/src/main/java/org/solovyev/android/calculator/functions/EditFunctionFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/functions/EditFunctionFragment.java @@ -8,7 +8,7 @@ import android.support.annotation.NonNull; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.support.v7.app.AlertDialog; - +import jscl.math.function.Function; import org.solovyev.android.Activities; import org.solovyev.android.Check; import org.solovyev.android.calculator.App; @@ -19,8 +19,6 @@ import org.solovyev.android.calculator.entities.EntityRemovalDialog; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import jscl.math.function.Function; - public class EditFunctionFragment extends BaseFunctionFragment { public EditFunctionFragment() { @@ -61,7 +59,7 @@ public class EditFunctionFragment extends BaseFunctionFragment { protected void onPrepareDialog(@NonNull AlertDialog.Builder builder) { super.onPrepareDialog(builder); if (!isNewFunction()) { - builder.setNeutralButton(R.string.c_remove, null); + builder.setNeutralButton(R.string.cpp_delete, null); } } diff --git a/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsFragment.java b/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsFragment.java index 651e5e23..bff7750e 100644 --- a/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/functions/FunctionsFragment.java @@ -26,15 +26,11 @@ import android.content.DialogInterface; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.FragmentActivity; -import android.view.ContextMenu; -import android.view.LayoutInflater; -import android.view.MenuItem; -import android.view.View; -import android.view.ViewGroup; - +import android.view.*; import com.squareup.otto.Bus; import com.squareup.otto.Subscribe; - +import jscl.math.function.Function; +import jscl.math.function.IFunction; import org.solovyev.android.Check; import org.solovyev.android.calculator.AppComponent; import org.solovyev.android.calculator.Calculator; @@ -43,15 +39,11 @@ import org.solovyev.android.calculator.entities.BaseEntitiesFragment; import org.solovyev.android.calculator.entities.Category; import org.solovyev.android.calculator.entities.EntityRemovalDialog; -import jscl.math.function.Function; -import jscl.math.function.IFunction; - -import java.util.ArrayList; -import java.util.List; - import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.inject.Inject; +import java.util.ArrayList; +import java.util.List; public class FunctionsFragment extends BaseEntitiesFragment { @@ -79,8 +71,8 @@ public class FunctionsFragment extends BaseEntitiesFragment { protected void onCreateContextMenu(@Nonnull ContextMenu menu, @Nonnull Function function, @NonNull MenuItem.OnMenuItemClickListener listener) { addMenu(menu, R.string.c_use, listener); if (!function.isSystem()) { - addMenu(menu, R.string.c_edit, listener); - addMenu(menu, R.string.c_remove, listener); + addMenu(menu, R.string.cpp_edit, listener); + addMenu(menu, R.string.cpp_delete, listener); } } @@ -91,13 +83,13 @@ public class FunctionsFragment extends BaseEntitiesFragment { case R.string.c_use: onClick(function); return true; - case R.string.c_edit: + case R.string.cpp_edit: if (function instanceof IFunction) { EditFunctionFragment.show(CppFunction.builder((IFunction) function).build(), activity.getSupportFragmentManager()); } return true; - case R.string.c_remove: + case R.string.cpp_delete: EntityRemovalDialog.showForFunction(getActivity(), function.getName(), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { diff --git a/app/src/main/java/org/solovyev/android/calculator/history/BaseHistoryFragment.java b/app/src/main/java/org/solovyev/android/calculator/history/BaseHistoryFragment.java index 13668e1c..26b456f3 100644 --- a/app/src/main/java/org/solovyev/android/calculator/history/BaseHistoryFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/history/BaseHistoryFragment.java @@ -186,8 +186,8 @@ public abstract class BaseHistoryFragment extends BaseFragment { if (shouldHaveCopyResult(state)) { addMenu(menu, R.string.c_copy_result, this); } - addMenu(menu, R.string.c_edit, this); - addMenu(menu, R.string.c_remove, this); + addMenu(menu, R.string.cpp_edit, this); + addMenu(menu, R.string.cpp_delete, this); } } @@ -210,13 +210,13 @@ public abstract class BaseHistoryFragment extends BaseFragment { case R.string.c_copy_result: copyResult(state); return true; - case R.string.c_edit: + case R.string.cpp_edit: EditHistoryFragment.show(state, false, getFragmentManager()); return true; case R.string.c_save: EditHistoryFragment.show(state, true, getFragmentManager()); return true; - case R.string.c_remove: + case R.string.cpp_delete: history.removeSaved(state); return true; } diff --git a/app/src/main/java/org/solovyev/android/calculator/history/EditHistoryFragment.java b/app/src/main/java/org/solovyev/android/calculator/history/EditHistoryFragment.java index 30c9efc3..963b7956 100644 --- a/app/src/main/java/org/solovyev/android/calculator/history/EditHistoryFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/history/EditHistoryFragment.java @@ -71,7 +71,7 @@ public class EditHistoryFragment extends BaseDialogFragment { @Override protected void onPrepareDialog(@NonNull AlertDialog.Builder builder) { - builder.setNegativeButton(R.string.c_cancel, null); + builder.setNegativeButton(R.string.cpp_cancel, null); builder.setPositiveButton(R.string.c_save, null); } diff --git a/app/src/main/java/org/solovyev/android/calculator/history/HistoryActivity.java b/app/src/main/java/org/solovyev/android/calculator/history/HistoryActivity.java index e4f712d1..9bc111a0 100644 --- a/app/src/main/java/org/solovyev/android/calculator/history/HistoryActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/history/HistoryActivity.java @@ -22,8 +22,6 @@ package org.solovyev.android.calculator.history; -import static org.solovyev.android.calculator.FragmentTab.saved_history; - import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; @@ -31,17 +29,14 @@ import android.support.annotation.NonNull; import android.support.v4.app.Fragment; import android.support.v7.app.AlertDialog; import android.view.View; - -import org.solovyev.android.calculator.App; -import org.solovyev.android.calculator.AppComponent; -import org.solovyev.android.calculator.BaseActivity; -import org.solovyev.android.calculator.FragmentTab; -import org.solovyev.android.calculator.R; +import org.solovyev.android.calculator.*; import org.solovyev.android.calculator.view.Tabs; import javax.annotation.Nonnull; import javax.inject.Inject; +import static org.solovyev.android.calculator.FragmentTab.saved_history; + public class HistoryActivity extends BaseActivity { public static class Dialog extends HistoryActivity { @@ -96,7 +91,7 @@ public class HistoryActivity extends BaseActivity { } } }) - .setNegativeButton(R.string.c_cancel, null) + .setNegativeButton(R.string.cpp_cancel, null) .create() .show(); } diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/PlotFunctionsFragment.java b/app/src/main/java/org/solovyev/android/calculator/plot/PlotFunctionsFragment.java index 209b55e2..c8a2443b 100644 --- a/app/src/main/java/org/solovyev/android/calculator/plot/PlotFunctionsFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/PlotFunctionsFragment.java @@ -11,13 +11,10 @@ import android.support.annotation.Nullable; import android.support.v4.app.FragmentManager; import android.support.v7.app.AlertDialog; import android.support.v7.widget.RecyclerView; -import android.view.ContextMenu; -import android.view.LayoutInflater; -import android.view.MenuItem; -import android.view.View; -import android.view.ViewGroup; +import android.view.*; import android.widget.TextView; - +import butterknife.Bind; +import butterknife.ButterKnife; import org.solovyev.android.calculator.App; import org.solovyev.android.calculator.AppComponent; import org.solovyev.android.calculator.BaseDialogFragment; @@ -29,13 +26,9 @@ import org.solovyev.android.plotter.Plotter; import org.solovyev.android.views.llm.DividerItemDecoration; import org.solovyev.android.views.llm.LinearLayoutManager; -import java.util.List; - import javax.annotation.Nonnull; import javax.inject.Inject; - -import butterknife.Bind; -import butterknife.ButterKnife; +import java.util.List; import static android.support.v7.widget.LinearLayoutManager.VERTICAL; import static android.view.Menu.NONE; @@ -71,7 +64,7 @@ public class PlotFunctionsFragment extends BaseDialogFragment { @NonNull protected RecyclerView onCreateDialogView(@NonNull Context context, @NonNull LayoutInflater inflater, Bundle savedInstanceState) { - @SuppressLint("InflateParams") final RecyclerView view = (RecyclerView) inflater.inflate(R.layout.dialog_functions, null); + @SuppressLint("InflateParams") final RecyclerView view = (RecyclerView) inflater.inflate(R.layout.fragment_functions, null); final LinearLayoutManager layoutManager = new LinearLayoutManager(context, VERTICAL, false); final int itemHeight = context.getResources().getDimensionPixelSize(R.dimen.list_item_height); @@ -99,8 +92,8 @@ public class PlotFunctionsFragment extends BaseDialogFragment { } protected void onPrepareDialog(@NonNull AlertDialog.Builder builder) { - builder.setPositiveButton(android.R.string.ok, null); - builder.setNeutralButton("Add", null); + builder.setPositiveButton(R.string.cpp_close, null); + builder.setNeutralButton(R.string.cpp_add, null); } @Override @@ -144,12 +137,12 @@ public class PlotFunctionsFragment extends BaseDialogFragment { @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { - menu.add(NONE, R.string.c_remove, NONE, R.string.c_remove).setOnMenuItemClickListener(this); + menu.add(NONE, R.string.cpp_delete, NONE, R.string.cpp_delete).setOnMenuItemClickListener(this); } @Override public boolean onMenuItemClick(MenuItem item) { - if (function != null && item.getItemId() == R.string.c_remove) { + if (function != null && item.getItemId() == R.string.cpp_delete) { plotter.remove(function); return true; } @@ -168,7 +161,7 @@ public class PlotFunctionsFragment extends BaseDialogFragment { @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { final LayoutInflater inflater = LayoutInflater.from(parent.getContext()); - return new ViewHolder(inflater.inflate(R.layout.dialog_functions_function, parent, false)); + return new ViewHolder(inflater.inflate(R.layout.fragment_functions_function, parent, false)); } @Override diff --git a/app/src/main/java/org/solovyev/android/calculator/variables/EditVariableFragment.java b/app/src/main/java/org/solovyev/android/calculator/variables/EditVariableFragment.java index 846f41fa..770fa233 100644 --- a/app/src/main/java/org/solovyev/android/calculator/variables/EditVariableFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/variables/EditVariableFragment.java @@ -22,8 +22,6 @@ package org.solovyev.android.calculator.variables; -import static org.solovyev.android.calculator.variables.CppVariable.NO_ID; - import android.annotation.SuppressLint; import android.content.Context; import android.content.DialogInterface; @@ -43,17 +41,12 @@ import android.view.inputmethod.InputMethodManager; import android.widget.Button; import android.widget.EditText; import android.widget.PopupWindow; - +import butterknife.Bind; +import butterknife.ButterKnife; +import jscl.math.function.IConstant; import org.solovyev.android.Activities; import org.solovyev.android.Check; -import org.solovyev.android.calculator.App; -import org.solovyev.android.calculator.AppComponent; -import org.solovyev.android.calculator.BaseDialogFragment; -import org.solovyev.android.calculator.Calculator; -import org.solovyev.android.calculator.Engine; -import org.solovyev.android.calculator.Keyboard; -import org.solovyev.android.calculator.R; -import org.solovyev.android.calculator.VariablesRegistry; +import org.solovyev.android.calculator.*; import org.solovyev.android.calculator.entities.EntityRemovalDialog; import org.solovyev.android.calculator.functions.FunctionsRegistry; import org.solovyev.android.calculator.keyboard.FloatingKeyboard; @@ -62,16 +55,13 @@ import org.solovyev.android.calculator.math.MathType; import org.solovyev.android.calculator.view.EditTextCompat; import org.solovyev.common.text.Strings; -import butterknife.Bind; -import butterknife.ButterKnife; -import jscl.math.function.IConstant; - -import java.util.Arrays; -import java.util.List; - import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.inject.Inject; +import java.util.Arrays; +import java.util.List; + +import static org.solovyev.android.calculator.variables.CppVariable.NO_ID; public class EditVariableFragment extends BaseDialogFragment implements View.OnFocusChangeListener, View.OnKeyListener, View.OnClickListener { @@ -160,11 +150,11 @@ public class EditVariableFragment extends BaseDialogFragment implements View.OnF @Override protected void onPrepareDialog(@NonNull AlertDialog.Builder builder) { - builder.setNegativeButton(R.string.c_cancel, null); - builder.setPositiveButton(R.string.ok, null); + builder.setNegativeButton(R.string.cpp_cancel, null); + builder.setPositiveButton(R.string.cpp_done, null); builder.setTitle(isNewVariable() ? R.string.c_var_create_var : R.string.c_var_edit_var); if (!isNewVariable()) { - builder.setNeutralButton(R.string.c_remove, null); + builder.setNeutralButton(R.string.cpp_delete, null); } } diff --git a/app/src/main/java/org/solovyev/android/calculator/variables/VariablesFragment.java b/app/src/main/java/org/solovyev/android/calculator/variables/VariablesFragment.java index 550093ec..4ea56b45 100644 --- a/app/src/main/java/org/solovyev/android/calculator/variables/VariablesFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/variables/VariablesFragment.java @@ -107,12 +107,12 @@ public class VariablesFragment extends BaseEntitiesFragment { protected void onCreateContextMenu(@Nonnull ContextMenu menu, @Nonnull IConstant variable, @Nonnull MenuItem.OnMenuItemClickListener listener) { addMenu(menu, R.string.c_use, listener); if (!variable.isSystem()) { - addMenu(menu, R.string.c_edit, listener); - addMenu(menu, R.string.c_remove, listener); + addMenu(menu, R.string.cpp_edit, listener); + addMenu(menu, R.string.cpp_delete, listener); } if (!Strings.isEmpty(variable.getValue())) { - addMenu(menu, R.string.c_copy_value, listener); + addMenu(menu, R.string.cpp_copy_text, listener); } } @@ -123,10 +123,10 @@ public class VariablesFragment extends BaseEntitiesFragment { case R.string.c_use: onClick(variable); return true; - case R.string.c_edit: + case R.string.cpp_edit: EditVariableFragment.showDialog(CppVariable.builder(variable).build(), activity); return true; - case R.string.c_remove: + case R.string.cpp_delete: EntityRemovalDialog.showForVariable(getActivity(), variable.getName(), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { @@ -135,7 +135,7 @@ public class VariablesFragment extends BaseEntitiesFragment { } }); return true; - case R.string.c_copy_value: + case R.string.cpp_copy_text: copyText(variable.getValue()); return true; } diff --git a/app/src/main/res/layout/fragment_function_edit_base_controls.xml b/app/src/main/res/layout/fragment_function_edit_base_controls.xml index 3e90baf1..7dac879a 100644 --- a/app/src/main/res/layout/fragment_function_edit_base_controls.xml +++ b/app/src/main/res/layout/fragment_function_edit_base_controls.xml @@ -52,7 +52,7 @@ a:id="@+id/function_body" a:layout_width="match_parent" a:layout_height="wrap_content" - a:hint="@string/c_function_value" + a:hint="@string/cpp_function_body" a:imeOptions="flagNoExtractUi" a:inputType="text" /> @@ -66,7 +66,7 @@ a:id="@+id/function_description" a:layout_width="match_parent" a:layout_height="wrap_content" - a:hint="@string/c_function_description" + a:hint="@string/cpp_description" a:inputType="textMultiLine" a:maxLines="4" /> diff --git a/app/src/main/res/layout/dialog_functions.xml b/app/src/main/res/layout/fragment_functions.xml similarity index 100% rename from app/src/main/res/layout/dialog_functions.xml rename to app/src/main/res/layout/fragment_functions.xml diff --git a/app/src/main/res/layout/dialog_functions_function.xml b/app/src/main/res/layout/fragment_functions_function.xml similarity index 100% rename from app/src/main/res/layout/dialog_functions_function.xml rename to app/src/main/res/layout/fragment_functions_function.xml diff --git a/app/src/main/res/values-ar/text_imported.xml b/app/src/main/res/values-ar/text_imported.xml index ee4a2f67..aaf553da 100644 --- a/app/src/main/res/values-ar/text_imported.xml +++ b/app/src/main/res/values-ar/text_imported.xml @@ -13,9 +13,15 @@ إنشاء إغلاق تبديل + إضافة تعديل حذف - تم + تم إلغاء الوصف + نسخ إلى الحافظة + تم نسخ النص + الاسم + ليس رقمًا + خطأ \ No newline at end of file diff --git a/app/src/main/res/values-cs/text_imported.xml b/app/src/main/res/values-cs/text_imported.xml index 24b40a8b..c92925e6 100644 --- a/app/src/main/res/values-cs/text_imported.xml +++ b/app/src/main/res/values-cs/text_imported.xml @@ -13,9 +13,15 @@ Vytvořit Zavřít Přepnout + Přidat Upravit Smazat - Hotovo + Hotovo Zrušit Popis + Zkopírovat do schránky + Text zkopírován + Jméno + Není číslo + Chyba \ No newline at end of file diff --git a/app/src/main/res/values-de/text_imported.xml b/app/src/main/res/values-de/text_imported.xml index 32f83649..e780a3a5 100644 --- a/app/src/main/res/values-de/text_imported.xml +++ b/app/src/main/res/values-de/text_imported.xml @@ -13,9 +13,15 @@ Erstellen Schließen Wechseln + Hinzufügen Bearbeiten Löschen - Fertig + Fertig Abbrechen Beschreibung + In Zwischenablage kopieren + Text kopiert + Name + Keine Zahl + Fehler \ No newline at end of file diff --git a/app/src/main/res/values-es/text_imported.xml b/app/src/main/res/values-es/text_imported.xml index 4375c4dc..c2f4a583 100644 --- a/app/src/main/res/values-es/text_imported.xml +++ b/app/src/main/res/values-es/text_imported.xml @@ -13,9 +13,15 @@ Crear Cerrar Cambiar + Añadir Editar Eliminar - Listo + Listo Cancelar Descripción + Copiar en el portapapeles + Texto copiado + Nombre + No es un número + Error \ No newline at end of file diff --git a/app/src/main/res/values-fi/text_imported.xml b/app/src/main/res/values-fi/text_imported.xml index 4fb6708a..823534ac 100644 --- a/app/src/main/res/values-fi/text_imported.xml +++ b/app/src/main/res/values-fi/text_imported.xml @@ -13,9 +13,15 @@ Luo Sulje Vaihda + Lisää Muokkaa Poista - Valmis + Valmis Peruuta Kuvaus + Kopioi leikepöydälle + Teksti kopioitu + Nimi + Ei ole numero + Virhe \ No newline at end of file diff --git a/app/src/main/res/values-fr/text_imported.xml b/app/src/main/res/values-fr/text_imported.xml index dc8adbcc..cfe615e1 100644 --- a/app/src/main/res/values-fr/text_imported.xml +++ b/app/src/main/res/values-fr/text_imported.xml @@ -13,9 +13,15 @@ Créer Fermer Changer + Ajouter Modifier Supprimer - OK + OK Annuler Description + Copier dans le presse-papiers + Texte copié + Nom + Pas un nombre. + Erreur \ No newline at end of file diff --git a/app/src/main/res/values-it/text_imported.xml b/app/src/main/res/values-it/text_imported.xml index bb4c32d5..0a999493 100644 --- a/app/src/main/res/values-it/text_imported.xml +++ b/app/src/main/res/values-it/text_imported.xml @@ -13,9 +13,15 @@ Crea Chiudi Cambia + Aggiungi Modifica Elimina - Salva + Salva Annulla Descrizione + Copia negli appunti + Testo copiato + Nome + Non è un numero + Errore \ No newline at end of file diff --git a/app/src/main/res/values-ja/text_imported.xml b/app/src/main/res/values-ja/text_imported.xml index 9936b8e6..b03d9146 100644 --- a/app/src/main/res/values-ja/text_imported.xml +++ b/app/src/main/res/values-ja/text_imported.xml @@ -13,9 +13,15 @@ 作成 閉じる 切り替え + 追加 編集 削除 - 完了 + 完了 キャンセル 説明 + クリップボードにコピー + テキストをコピーしました + 名前 + 数字以外の値 + エラー \ No newline at end of file diff --git a/app/src/main/res/values-nl/text_imported.xml b/app/src/main/res/values-nl/text_imported.xml index f206d8ff..75335919 100644 --- a/app/src/main/res/values-nl/text_imported.xml +++ b/app/src/main/res/values-nl/text_imported.xml @@ -13,9 +13,15 @@ Aanmaken Sluiten Overschakelen + Toevoegen Bewerken Verwijderen - Gereed + Gereed Annuleren Beschrijving + Kopiëren naar klembord + Tekst gekopieerd + Naam + Is geen getal + Fout \ No newline at end of file diff --git a/app/src/main/res/values-pl/text_imported.xml b/app/src/main/res/values-pl/text_imported.xml index 72af86d5..9bd25042 100644 --- a/app/src/main/res/values-pl/text_imported.xml +++ b/app/src/main/res/values-pl/text_imported.xml @@ -13,9 +13,15 @@ Utwórz Zamknij Przełącz + Dodaj Edytuj Usuń - Gotowe + Gotowe Anuluj Opis + Kopiuj do schowka + Tekst skopiowany + Imię i nazwisko + To nie liczba + Błąd \ No newline at end of file diff --git a/app/src/main/res/values-pt-rBR/text_imported.xml b/app/src/main/res/values-pt-rBR/text_imported.xml index ef159d1d..30c74326 100644 --- a/app/src/main/res/values-pt-rBR/text_imported.xml +++ b/app/src/main/res/values-pt-rBR/text_imported.xml @@ -13,9 +13,15 @@ Criar Fechar Alternar + Adicionar Editar Excluir - Concluído + Concluído Cancelar Descrição + Copiar para área de transferência + Texto copiado + Nome + Não é número + Erro \ No newline at end of file diff --git a/app/src/main/res/values-pt-rPT/text_imported.xml b/app/src/main/res/values-pt-rPT/text_imported.xml index 0b94e4cc..41b889a3 100644 --- a/app/src/main/res/values-pt-rPT/text_imported.xml +++ b/app/src/main/res/values-pt-rPT/text_imported.xml @@ -13,9 +13,15 @@ Criar Fechar Alternar + Adicionar Editar Eliminar - Concluído + Concluído Cancelar Descrição + Copiar para área de transf. + Texto copiado + Nome + Não é um núm. + Erro \ No newline at end of file diff --git a/app/src/main/res/values-ru/text_imported.xml b/app/src/main/res/values-ru/text_imported.xml index 0a7f1db0..13a97030 100644 --- a/app/src/main/res/values-ru/text_imported.xml +++ b/app/src/main/res/values-ru/text_imported.xml @@ -13,9 +13,15 @@ Создать Закрыть Сменить аккаунт + Добавить Изменить Удалить - Готово + Готово Отмена Описание + Копировать в буфер обмена + Текст скопирован + Имя + Не число + Ошибка \ No newline at end of file diff --git a/app/src/main/res/values-tr/text_imported.xml b/app/src/main/res/values-tr/text_imported.xml index 4a72cbb0..d34b43bb 100644 --- a/app/src/main/res/values-tr/text_imported.xml +++ b/app/src/main/res/values-tr/text_imported.xml @@ -13,9 +13,15 @@ Oluştur Kapat Değiştir + Ekle Düzenle Sil - Bitti + Bitti İptal Açıklama + Panoya kopyala + Metin kopyalandı + Ad + Sayı değil + Hata \ No newline at end of file diff --git a/app/src/main/res/values-vi/text_imported.xml b/app/src/main/res/values-vi/text_imported.xml index a44eeb02..6cbabc5e 100644 --- a/app/src/main/res/values-vi/text_imported.xml +++ b/app/src/main/res/values-vi/text_imported.xml @@ -13,9 +13,15 @@ Tạo Đóng Chuyển đổi + Thêm Chỉnh sửa Xóa - Xong + Xong Hủy Mô tả + Sao chép vào khay nhớ tạm + Đã sao chép văn bản + Tên + Không phải số + Lỗi \ No newline at end of file diff --git a/app/src/main/res/values-zh-rCN/text_imported.xml b/app/src/main/res/values-zh-rCN/text_imported.xml index 0868c578..4f86d303 100644 --- a/app/src/main/res/values-zh-rCN/text_imported.xml +++ b/app/src/main/res/values-zh-rCN/text_imported.xml @@ -13,9 +13,15 @@ 创建 关闭 切换 + 添加 编辑 删除 - 完成 + 完成 取消 说明 + 复制到剪贴板 + 文本已复制 + 姓名 + 不是数字 + 错误 \ No newline at end of file diff --git a/app/src/main/res/values-zh-rTW/text_imported.xml b/app/src/main/res/values-zh-rTW/text_imported.xml index e834ed94..d71c93d3 100644 --- a/app/src/main/res/values-zh-rTW/text_imported.xml +++ b/app/src/main/res/values-zh-rTW/text_imported.xml @@ -13,9 +13,15 @@ 建立 關閉 切換 + 新增 編輯 刪除 - 完成 + 完成 取消 說明 + 複製到剪貼簿 + 文字已複製 + 姓名 + 非數字 + 錯誤 \ No newline at end of file diff --git a/app/src/main/res/values/text_imported.xml b/app/src/main/res/values/text_imported.xml index b43d5fc0..1e2e4f36 100644 --- a/app/src/main/res/values/text_imported.xml +++ b/app/src/main/res/values/text_imported.xml @@ -13,9 +13,15 @@ Create Close Switch + Add Edit Delete - Done + Done Cancel Description + Copy to clipboard + Text copied + Name + Not a number + Error \ No newline at end of file diff --git a/app/src/main/res/values/text_non_translatable.xml b/app/src/main/res/values/text_non_translatable.xml index 27234069..10e9c7a1 100644 --- a/app/src/main/res/values/text_non_translatable.xml +++ b/app/src/main/res/values/text_non_translatable.xml @@ -14,4 +14,5 @@ X max Y min Y max + f(x, y) \ No newline at end of file diff --git a/translations/src/main/java/org/solovyev/android/translations/Android.java b/translations/src/main/java/org/solovyev/android/translations/Android.java index 6f2c2911..0ebb8c8f 100644 --- a/translations/src/main/java/org/solovyev/android/translations/Android.java +++ b/translations/src/main/java/org/solovyev/android/translations/Android.java @@ -11,6 +11,8 @@ public class Android { private static final List settingsLinks = new ArrayList<>(); private static final List calendarLinks = new ArrayList<>(); + private static final List contactsLinks = new ArrayList<>(); + private static final List calculatorLinks = new ArrayList<>(); static { settingsLinks.add(new TranslationLink("haptic_feedback_enable_title", "cpp_prefs_vibrate_on_keypress")); @@ -26,24 +28,34 @@ public class Android { settingsLinks.add(new TranslationLink("create", "cpp_create")); settingsLinks.add(new TranslationLink("dlg_close", "cpp_close")); settingsLinks.add(new TranslationLink("dlg_switch", "cpp_switch")); + settingsLinks.add(new TranslationLink("user_dict_settings_add_menu_title", "cpp_add")); calendarLinks.add(new TranslationLink("edit_label", "cpp_edit")); calendarLinks.add(new TranslationLink("delete_label", "cpp_delete")); - calendarLinks.add(new TranslationLink("save_label", "cpp_save")); + calendarLinks.add(new TranslationLink("save_label", "cpp_done")); calendarLinks.add(new TranslationLink("discard_label", "cpp_cancel")); calendarLinks.add(new TranslationLink("hint_description", "cpp_description")); + + contactsLinks.add(new TranslationLink("copy_text", "cpp_copy_text")); + contactsLinks.add(new TranslationLink("toast_text_copied", "cpp_text_copied")); + contactsLinks.add(new TranslationLink("header_name_entry", "cpp_name")); + + calculatorLinks.add(new TranslationLink("error_nan", "cpp_nan")); + calculatorLinks.add(new TranslationLink("error_syntax", "cpp_error")); } public static void main(String... args) throws Exception { final Options options = new Options(); - options.addOption(Option.builder("as").longOpt("aosp-settings").hasArg().desc("Local location of aosp/platform/packages/apps/settings").required().build()); - options.addOption(Option.builder("ac").longOpt("aosp-calendar").hasArg().desc("Local location of aosp/platform/packages/apps/calendar").required().build()); + options.addOption(Option.builder("aosp").hasArg().desc("Local location of aosp project").required().build()); final CommandLineParser parser = new DefaultParser(); final CommandLine commandLine = parser.parse(options, args); - final File aospSettings = makeInputDirectory(commandLine.getOptionValue("as")); - final File aospCalendar = makeInputDirectory(commandLine.getOptionValue("ac")); + final String aosp = commandLine.getOptionValue("aosp"); + final File aospSettings = makeInputDirectory(aosp + "/platform/packages/apps/settings"); + final File aospCalendar = makeInputDirectory(aosp + "/platform/packages/apps/calendar"); + final File aospContacts = makeInputDirectory(aosp + "/platform/packages/apps/contacts"); + final File aospCalculator = makeInputDirectory(aosp + "/platform/packages/apps/calculator"); final File outDir = new File("build/translations/res"); Utils.delete(outDir); @@ -55,6 +67,8 @@ public class Android { Resources translations = new Resources(); translate(readResources(aospSettings, languageLocale), translations, settingsLinks); translate(readResources(aospCalendar, languageLocale), translations, calendarLinks); + translate(readResources(aospContacts, languageLocale), translations, contactsLinks); + translate(readResources(aospCalculator, languageLocale), translations, calculatorLinks); Utils.saveTranslations(translations, languageLocale, outDir, "text_imported.xml"); } }