diff options
author | Dmitry Yunitsky <yunik@mapswithme.com> | 2016-02-09 16:08:17 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:17:01 +0300 |
commit | 0fa3f58eaf902747d1d002a558e0d6a6fd94a1f1 (patch) | |
tree | 6ae82ec647551611f201d42a01f42d0d5aa95386 | |
parent | 4390c5a893683fb8ce8be326821e72d837b6c097 (diff) |
[android] Use translations in editor.
11 files changed, 44 insertions, 40 deletions
diff --git a/android/res/layout/fragment_auth_editor.xml b/android/res/layout/fragment_auth_editor.xml index df2980691c..9e794437de 100644 --- a/android/res/layout/fragment_auth_editor.xml +++ b/android/res/layout/fragment_auth_editor.xml @@ -76,7 +76,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/margin_base" - android:text="You first object!" + android:padding="@dimen/margin_half" + android:text="@string/you_have_edited_your_first_object" android:textAppearance="@style/MwmTextAppearance.Body3.Light"/> <Button @@ -92,7 +93,7 @@ android:paddingLeft="@dimen/margin_half" android:paddingRight="@dimen/margin_half" android:paddingStart="@dimen/margin_half" - android:text="Google" + android:text="@string/login_with_google" android:textAllCaps="true" android:textAppearance="@style/MwmTextAppearance.Body1" tools:targetApi="jelly_bean"/> @@ -110,7 +111,7 @@ android:paddingLeft="@dimen/margin_half" android:paddingRight="@dimen/margin_half" android:paddingStart="@dimen/margin_half" - android:text="Facebook" + android:text="@string/login_with_facebook" android:textAllCaps="true" android:textAppearance="@style/MwmTextAppearance.Body1.Light" tools:targetApi="jelly_bean"/> @@ -121,7 +122,7 @@ android:layout_height="@dimen/editor_auth_btn_height" android:background="?buttonAccent" android:fontFamily="@string/robotoMedium" - android:text="Log in with osm" + android:text="@string/login_with_openstreetmap" android:textAllCaps="true" android:textAppearance="@style/MwmTextAppearance.Body1.Light" tools:targetApi="jelly_bean"/> @@ -130,7 +131,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="@dimen/margin_double" - android:text="Do you have OSM account?" + android:padding="@dimen/margin_half" + android:text="@string/no_osm_account" android:textAllCaps="true" android:textAppearance="@style/MwmTextAppearance.Body3.Light"/> @@ -140,9 +142,8 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/margin_half" android:background="?clickableBackground" - android:paddingBottom="@dimen/margin_half" - android:paddingTop="@dimen/margin_half" - android:text="Register" + android:padding="@dimen/margin_half" + android:text="@string/register_at_openstreetmap" android:textAllCaps="true" android:textAppearance="@style/MwmTextAppearance.Body1.Light"/> diff --git a/android/res/layout/fragment_editor.xml b/android/res/layout/fragment_editor.xml index 9264ce69da..7984b17a19 100644 --- a/android/res/layout/fragment_editor.xml +++ b/android/res/layout/fragment_editor.xml @@ -34,11 +34,12 @@ <EditText android:id="@+id/input" style="@style/MwmWidget.Editor.FieldLayout.EditText" - android:hint="@string/name" + android:hint="@string/place_name" android:singleLine="true"/> </com.mapswithme.maps.widget.CustomTextInputLayout> + <!-- TODO set translated text --> <TextView android:id="@+id/name_multilang" android:layout_width="match_parent" @@ -92,7 +93,7 @@ android:layout_marginLeft="@dimen/editor_margin_left" android:layout_marginStart="@dimen/editor_margin_left" android:gravity="center_vertical" - android:text="Street" + android:text="@string/street" android:textAppearance="@style/MwmTextAppearance.Body4"/> <TextView @@ -132,7 +133,7 @@ <EditText android:id="@+id/input" style="@style/MwmWidget.Editor.FieldLayout.EditText" - android:hint="building" + android:hint="@string/house" tools:text="79-59"/> </com.mapswithme.maps.widget.CustomTextInputLayout> @@ -161,7 +162,7 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/margin_base" android:fontFamily="@string/robotoMedium" - android:text="Details" + android:text="@string/details" android:textAppearance="@style/MwmTextAppearance.Body3" tools:ignore="UnusedAttribute"/> @@ -175,7 +176,7 @@ android:background="?clickableBackground" android:gravity="center_vertical" android:minHeight="@dimen/base_block_size" - android:text="Edit opening hours" + android:text="@string/edit_opening_hours" android:textAllCaps="true" android:textAppearance="@style/MwmTextAppearance.Body1" android:textColor="?colorAccent"/> @@ -195,7 +196,7 @@ <EditText android:id="@+id/input" style="@style/MwmWidget.Editor.FieldLayout.EditText" - android:hint="phone" + android:hint="@string/phone" android:textAppearance="@style/MwmTextAppearance.Body1" tools:text="+937 99 92"/> @@ -218,7 +219,7 @@ <EditText android:id="@+id/input" style="@style/MwmWidget.Editor.FieldLayout.EditText" - android:hint="web" + android:hint="@string/website" android:textAppearance="@style/MwmTextAppearance.Body1" tools:text="maps.me"/> @@ -241,7 +242,7 @@ <EditText android:id="@+id/input" style="@style/MwmWidget.Editor.FieldLayout.EditText" - android:hint="email" + android:hint="@string/email" android:textAppearance="@style/MwmTextAppearance.Body1" tools:text="bugs@maps.me"/> @@ -298,7 +299,7 @@ android:layout_marginStart="@dimen/editor_margin_left" android:layout_toLeftOf="@+id/sw__wifi" android:layout_toStartOf="@+id/sw__wifi" - android:text="Wi-Fi"/> + android:text="@string/wifi"/> <android.support.v7.widget.SwitchCompat android:id="@+id/sw__wifi" diff --git a/android/res/layout/fragment_osm_login.xml b/android/res/layout/fragment_osm_login.xml index 009fac78a4..256c114937 100644 --- a/android/res/layout/fragment_osm_login.xml +++ b/android/res/layout/fragment_osm_login.xml @@ -39,7 +39,7 @@ <EditText android:id="@+id/osm_username" style="@style/MwmWidget.Editor.FieldLayout.EditText" - android:hint="Email address or username" + android:hint="@string/email_or_username" android:textAppearance="@style/MwmTextAppearance.Body1"/> </com.mapswithme.maps.widget.CustomTextInputLayout> @@ -53,7 +53,7 @@ <EditText android:id="@+id/osm_password" style="@style/MwmWidget.Editor.FieldLayout.EditText" - android:hint="Password" + android:hint="@string/password" android:inputType="textPassword" android:textAppearance="@style/MwmTextAppearance.Body1"/> @@ -87,10 +87,10 @@ android:id="@+id/lost_password" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="right" + android:layout_gravity="end" android:background="?clickableBackground" android:padding="@dimen/margin_half" - android:text="Lost password" + android:text="@string/forgot_password" android:textAllCaps="true" android:textAppearance="@style/MwmTextAppearance.Body3"/> diff --git a/android/res/layout/fragment_timetable_advanced.xml b/android/res/layout/fragment_timetable_advanced.xml index dcca5be0c1..379169b683 100644 --- a/android/res/layout/fragment_timetable_advanced.xml +++ b/android/res/layout/fragment_timetable_advanced.xml @@ -60,7 +60,7 @@ android:drawableStart="@drawable/ic_type_text" android:gravity="center_vertical" android:padding="@dimen/margin_base" - android:text="Example values" + android:text="@string/editor_example_values" android:textAppearance="@style/MwmTextAppearance.Body3" android:textColor="@color/base_accent"/> @@ -70,6 +70,7 @@ android:layout_below="@id/tv__examples_title" android:background="@color/divider"/> + <!-- TODO set correct text of example --> <TextView android:id="@+id/tv__examples" android:layout_width="match_parent" diff --git a/android/res/layout/fragment_timetable_picker.xml b/android/res/layout/fragment_timetable_picker.xml index f591448a7f..c10920a9e3 100644 --- a/android/res/layout/fragment_timetable_picker.xml +++ b/android/res/layout/fragment_timetable_picker.xml @@ -11,12 +11,12 @@ android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="@dimen/base_block_size" - android:elevation="@dimen/appbar_elevation" android:background="@android:color/white" + android:elevation="@dimen/appbar_elevation" app:tabGravity="fill" + app:tabIndicatorColor="?colorAccent" app:tabMode="fixed" tools:ignore="UnusedAttribute"/> - <!--app:tabIndicatorColor="@color/base_blue_light"--> <TimePicker android:id="@+id/picker" diff --git a/android/res/layout/item_timetable_closed_hours.xml b/android/res/layout/item_timetable_closed_hours.xml index d4c0721761..2edf7ad60c 100644 --- a/android/res/layout/item_timetable_closed_hours.xml +++ b/android/res/layout/item_timetable_closed_hours.xml @@ -25,7 +25,7 @@ android:layout_marginStart="@dimen/margin_base" android:layout_toLeftOf="@id/iv__remove_closed" android:layout_toStartOf="@id/iv__remove_closed" - android:text="Hours closed" + android:text="@string/editor_hours_closed" android:textAppearance="@style/MwmTextAppearance.Body3"/> <TextView @@ -44,7 +44,7 @@ <View android:layout_width="match_parent" android:layout_height="1dp" - android:layout_alignParentBottom="true"/> - <!--android:background="@color/base_black_divider"/>--> + android:layout_alignParentBottom="true" + android:background="@color/divider"/> </RelativeLayout>
\ No newline at end of file diff --git a/android/src/com/mapswithme/maps/editor/AuthFragment.java b/android/src/com/mapswithme/maps/editor/AuthFragment.java index 75699e1a23..1a78750b21 100644 --- a/android/src/com/mapswithme/maps/editor/AuthFragment.java +++ b/android/src/com/mapswithme/maps/editor/AuthFragment.java @@ -32,7 +32,7 @@ public class AuthFragment extends BaseAuthFragment implements View.OnClickListen public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - mToolbarController.setTitle("Thank you!"); + mToolbarController.setTitle(R.string.thank_you); view.findViewById(R.id.login_osm).setOnClickListener(this); view.findViewById(R.id.login_facebook).setOnClickListener(this); view.findViewById(R.id.login_google).setOnClickListener(this); diff --git a/android/src/com/mapswithme/maps/editor/EditorHostFragment.java b/android/src/com/mapswithme/maps/editor/EditorHostFragment.java index 4f2e147306..1fb9fc65c6 100644 --- a/android/src/com/mapswithme/maps/editor/EditorHostFragment.java +++ b/android/src/com/mapswithme/maps/editor/EditorHostFragment.java @@ -82,7 +82,7 @@ public class EditorHostFragment extends BaseMwmToolbarFragment protected void editMapObject() { mMode = Mode.MAP_OBJECT; - mToolbarController.setTitle("Edit POI"); + mToolbarController.setTitle(R.string.edit_place); final Bundle args = new Bundle(); args.putParcelable(EXTRA_MAP_OBJECT, mEditedObject); final Fragment editorFragment = Fragment.instantiate(getActivity(), EditorFragment.class.getName(), args); @@ -95,7 +95,7 @@ public class EditorHostFragment extends BaseMwmToolbarFragment { saveEditedPoi(); mMode = Mode.OPENING_HOURS; - mToolbarController.setTitle("Opening hours"); + mToolbarController.setTitle(R.string.editor_time_title); final Bundle args = new Bundle(); args.putString(TimetableFragment.EXTRA_TIME, mEditedObject.getMetadata(Metadata.MetadataType.FMD_OPEN_HOURS)); final Fragment editorFragment = Fragment.instantiate(getActivity(), TimetableFragment.class.getName(), args); @@ -108,7 +108,7 @@ public class EditorHostFragment extends BaseMwmToolbarFragment { saveEditedPoi(); mMode = Mode.STREET; - mToolbarController.setTitle("Add Street"); + mToolbarController.setTitle(R.string.choose_street); final Bundle args = new Bundle(); args.putString(StreetFragment.EXTRA_CURRENT_STREET, mEditedObject.getStreet()); final Fragment streetFragment = Fragment.instantiate(getActivity(), StreetFragment.class.getName(), args); @@ -121,7 +121,7 @@ public class EditorHostFragment extends BaseMwmToolbarFragment { saveEditedPoi(); mMode = Mode.CUISINE; - mToolbarController.setTitle("Cuisine"); + mToolbarController.setTitle(R.string.select_cuisine); final Bundle args = new Bundle(); args.putString(CuisineFragment.EXTRA_CURRENT_CUISINE, mEditedObject.getMetadata(Metadata.MetadataType.FMD_CUISINE)); final Fragment cuisineFragment = Fragment.instantiate(getActivity(), CuisineFragment.class.getName(), args); diff --git a/android/src/com/mapswithme/maps/editor/OsmAuthFragment.java b/android/src/com/mapswithme/maps/editor/OsmAuthFragment.java index 5399cc7697..76720511d7 100644 --- a/android/src/com/mapswithme/maps/editor/OsmAuthFragment.java +++ b/android/src/com/mapswithme/maps/editor/OsmAuthFragment.java @@ -60,7 +60,7 @@ public class OsmAuthFragment extends BaseAuthFragment implements View.OnClickLis public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - mToolbarController.setTitle("Log In"); + mToolbarController.setTitle(R.string.login); mEtLogin = (EditText) view.findViewById(R.id.osm_username); mEtPassword = (EditText) view.findViewById(R.id.osm_password); mTvLogin = (TextView) view.findViewById(R.id.login); @@ -117,7 +117,7 @@ public class OsmAuthFragment extends BaseAuthFragment implements View.OnClickLis enableInput(true); UiUtils.hide(mProgress); - mTvLogin.setText("Login"); + mTvLogin.setText(R.string.login); processAuth(auth); } }); diff --git a/android/src/com/mapswithme/maps/editor/ProfileFragment.java b/android/src/com/mapswithme/maps/editor/ProfileFragment.java index 529d0716a9..0a426a6e9b 100644 --- a/android/src/com/mapswithme/maps/editor/ProfileFragment.java +++ b/android/src/com/mapswithme/maps/editor/ProfileFragment.java @@ -27,7 +27,7 @@ public class ProfileFragment extends AuthFragment implements View.OnClickListene public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - mToolbarController.setTitle("OSM profile."); + mToolbarController.setTitle(R.string.profile); initViews(view); refreshViews(); } @@ -50,6 +50,7 @@ public class ProfileFragment extends AuthFragment implements View.OnClickListene mEditsSentDate = (TextView) sentEdits.findViewById(R.id.subtitle); UiUtils.hide(sentEdits.findViewById(R.id.more)); mAuthBlock = view.findViewById(R.id.block_auth); + ((TextView) mAuthBlock.findViewById(R.id.first_osm_edit)).setText(R.string.login_and_edit_map_motivation_message); } protected void refreshViews() @@ -65,8 +66,8 @@ public class ProfileFragment extends AuthFragment implements View.OnClickListene UiUtils.hide(mLogout); } final long[] stats = Editor.nativeGetStats(); - mEditsLocal.setText("Local edits : " + stats[0]); - mEditsSent.setText("Uploaded edits : " + stats[1]); + mEditsLocal.setText(getString(R.string.not_sent) + ": " + stats[0]); + mEditsSent.setText(getString(R.string.changes) + ": " + stats[1]); if (stats[1] == 0) UiUtils.hide(mEditsSentDate); else diff --git a/android/src/com/mapswithme/maps/editor/TimetableFragment.java b/android/src/com/mapswithme/maps/editor/TimetableFragment.java index dde581ec6b..f124cd9a2b 100644 --- a/android/src/com/mapswithme/maps/editor/TimetableFragment.java +++ b/android/src/com/mapswithme/maps/editor/TimetableFragment.java @@ -118,7 +118,8 @@ public class TimetableFragment extends BaseMwmFragment return fragment != null && fragment.isAdded(); } - private @Nullable Timetable[] getFilledTimetables(Fragment fragment, TimetableProvider provider) + @Nullable + private Timetable[] getFilledTimetables(Fragment fragment, TimetableProvider provider) { if (!hasFilledTimetables(fragment)) return null; @@ -126,9 +127,8 @@ public class TimetableFragment extends BaseMwmFragment final Timetable[] timetables = provider.getTimetables(); if (timetables == null) { - // FIXME @yunikkk add correct text new AlertDialog.Builder(getActivity()) - .setMessage("Invalid formatted timetable!") + .setMessage(R.string.editor_correct_mistake) .create(); return null; } |