Skip to content

Commit

Permalink
add translation for all text
Browse files Browse the repository at this point in the history
  • Loading branch information
lucalewin committed Feb 20, 2022
1 parent d923c34 commit f52d4bf
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 31 deletions.
4 changes: 1 addition & 3 deletions app/src/main/java/dev/lucalewin/planer/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;

import de.dlyt.yanndroid.oneui.layout.ToolbarLayout;
import de.dlyt.yanndroid.oneui.widget.SwipeRefreshLayout;
Expand All @@ -22,7 +21,6 @@
import dev.lucalewin.planer.iserv.web_scraping.IservWebScraper;
import dev.lucalewin.planer.iserv.web_scraping.TaskRunner;
import dev.lucalewin.planer.preferences.Preferences;
import dev.lucalewin.planer.preferences.language.LanguageUtil;
import dev.lucalewin.planer.util.Tuple;

public class MainActivity extends BaseThemeActivity {
Expand All @@ -45,7 +43,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

LanguageUtil.init(this);
// LanguageUtil.init(this);

mContext = this;
toolbarLayout = findViewById(R.id.main_toolbar_layout);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/settings_toolbar_layout"
app:title="Settings"
app:title="@string/settings"
app:expanded="false"
app:layout_behavior="@string/sesl_appbar_scrolling_view_behavior"
app:navigationIcon="@drawable/ic_samsung_arrow_left"
Expand Down
22 changes: 18 additions & 4 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Planer</string>
<string name="app_info">Info</string>
<string name="app_info">Info zu Planer</string>
<string name="settings">Einstellungen</string>
<string name="iserv_base_url_str">Iserv Base URL</string>
<string name="username">Benutzername</string>
Expand All @@ -10,10 +9,25 @@
<string name="cancel">Abbruch</string>
<string name="today">Heute</string>
<string name="tomorrow">Morgen</string>
<string name="general">Allgemein</string>
<string name="type">Type</string>
<string name="type">Art</string>
<string name="missing">Fehlt</string>
<string name="hour">Stunde</string>
<string name="language">Sprache</string>
<string name="notifications">Benachrichtigungen</string>
<string name="course">Kurs</string>
<string name="lesson">Stunde</string>
<string name="teacher">Lehrer</string>
<string name="privacy_policy">Datenschutz</string>
<string name="contact">Kontakt</string>
<string name="preferences">Style</string>
<string name="courses">Kurse</string>
<string name="account_planer_preference">Planer Account</string>
<string name="account_iserv_preference_title">Iserv Account</string>
<string name="_class">Klasse</string>
<string name="category_general">Allgemein</string>
<string name="category_planer">Planer</string>
<string name="category_accounts">Accounts</string>
<string name="category_information">Information</string>
<string name="account_planer_preference_summary">Klasse • Kurse</string>
<string name="account_iserv_preference_summary">URL • Benutzername • Password</string>
</resources>
21 changes: 18 additions & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources>
<string name="app_name">Planer</string>
<string name="app_info">Info</string>
<string name="app_name" translatable="false">Planer</string>
<string name="app_info">About Planer</string>
<string name="settings">Settings</string>
<string name="iserv_base_url_str">Iserv Base URL</string>
<string name="username">Username</string>
Expand All @@ -9,10 +9,25 @@
<string name="cancel">Cancel</string>
<string name="today">Today</string>
<string name="tomorrow">Tomorrow</string>
<string name="general">General</string>
<string name="type">Type</string>
<string name="missing">Missing</string>
<string name="hour">Hour</string>
<string name="language">Language</string>
<string name="notifications">Notifications</string>
<string name="course">Course</string>
<string name="lesson">Lesson</string>
<string name="teacher">Teacher</string>
<string name="privacy_policy">Privacy Policy</string>
<string name="contact">Contact us</string>
<string name="preferences">Preferences</string>
<string name="courses">Courses</string>
<string name="account_planer_preference">Planer Account</string>
<string name="account_iserv_preference_title">Iserv Account</string>
<string name="_class">Class</string>
<string name="category_general">General</string>
<string name="category_planer">Planer</string>
<string name="category_accounts">Accounts</string>
<string name="category_information">Information</string>
<string name="account_planer_preference_summary">Class • Courses</string>
<string name="account_iserv_preference_summary">URL • Username • Password</string>
</resources>
38 changes: 18 additions & 20 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,74 +3,72 @@
xmlns:app="http://schemas.android.com/apk/res-auto">

<de.dlyt.yanndroid.oneui.preference.PreferenceCategory
android:title="General">
android:title="@string/category_general">

<de.dlyt.yanndroid.oneui.preference.PreferenceScreen
android:key="preferences" android:title="Preferences" android:summary="Theme • Color">
android:key="preferences" android:title="@string/preferences" android:summary="Theme • Color">
</de.dlyt.yanndroid.oneui.preference.PreferenceScreen>

<de.dlyt.yanndroid.oneui.preference.PreferenceScreen
android:key="notifications" android:title="@string/notifications">
</de.dlyt.yanndroid.oneui.preference.PreferenceScreen>

<ListPreference
android:key="language_selector" android:title="@string/language" android:summary="English" android:entries="@array/languages" android:entryValues="@array/languages" />
android:key="language_selector" android:title="@string/language" android:entries="@array/languages" android:entryValues="@array/languages" />

</de.dlyt.yanndroid.oneui.preference.PreferenceCategory>

<de.dlyt.yanndroid.oneui.preference.PreferenceCategory
android:title="Planer">
android:title="@string/category_planer">

<SwitchPreferenceScreen
android:key="show_only_for_me" android:title="Show for me relevant info only" >
<!-- <intent-->
<!-- android:targetPackage="de.dlyt.yanndroid.oneuiexample" android:targetClass="de.dlyt.yanndroid.oneuiexample.SwitchBarActivity" />-->
</SwitchPreferenceScreen>
<!-- <SwitchPreferenceScreen-->
<!-- android:key="show_only_for_me" android:title="Show for me relevant info only" >-->
<!--&lt;!&ndash; <intent&ndash;&gt;-->
<!--&lt;!&ndash; android:targetPackage="de.dlyt.yanndroid.oneuiexample" android:targetClass="de.dlyt.yanndroid.oneuiexample.SwitchBarActivity" />&ndash;&gt;-->
<!-- </SwitchPreferenceScreen>-->

<EditTextPreference
android:key="class" android:title="Class" android:summary="current class" />
android:key="class" android:title="@string/_class" />

<MultiSelectListPreference
android:key="courses" android:title="Courses" android:summary="Select your courses • Available courses in your class" />
android:key="courses" android:title="@string/courses" android:summary="Select your courses • Available courses in your class" />

</de.dlyt.yanndroid.oneui.preference.PreferenceCategory>

<de.dlyt.yanndroid.oneui.preference.PreferenceCategory
android:title="Accounts">
android:title="@string/category_accounts">

<de.dlyt.yanndroid.oneui.preference.PreferenceScreen
android:key="planer_account" android:title="Planer Account" android:summary="Class • Courses">
android:key="planer_account" android:title="@string/account_planer_preference" android:summary="@string/account_planer_preference_summary">
<intent android:targetPackage="dev.lucalewin.planer" android:targetClass="dev.lucalewin.planer.PlanerAccountActivity" />
</de.dlyt.yanndroid.oneui.preference.PreferenceScreen>

<de.dlyt.yanndroid.oneui.preference.PreferenceScreen
android:key="iserv_account" android:title="Iserv Account" android:summary="URL • Username • Password">
android:key="iserv_account" android:title="@string/account_iserv_preference_title" android:summary="@string/account_iserv_preference_summary">
<intent android:targetPackage="dev.lucalewin.planer" android:targetClass="dev.lucalewin.planer.IservAccountSettingsActivity" />
</de.dlyt.yanndroid.oneui.preference.PreferenceScreen>

</de.dlyt.yanndroid.oneui.preference.PreferenceCategory>

<de.dlyt.yanndroid.oneui.preference.PreferenceCategory
android:title="Information">
android:title="@string/category_information">

<de.dlyt.yanndroid.oneui.preference.PreferenceScreen
android:key="privacy_policy" android:title="Privacy Policy">
android:key="privacy_policy" android:title="@string/privacy_policy">
<!-- <intent android:targetPackage="dev.lucalewin.planer" android:targetClass="dev.lucalewin.planer.PrivacyPolicyActivity" />-->
</de.dlyt.yanndroid.oneui.preference.PreferenceScreen>

<de.dlyt.yanndroid.oneui.preference.PreferenceScreen
android:key="about_app" android:title="About Planer">
android:key="about_app" android:title="@string/app_info">
<intent android:targetPackage="dev.lucalewin.planer" android:targetClass="dev.lucalewin.planer.AboutActivity" />
</de.dlyt.yanndroid.oneui.preference.PreferenceScreen>

<de.dlyt.yanndroid.oneui.preference.PreferenceScreen
android:key="contact_us" android:title="Contact us">
android:key="contact_us" android:title="@string/contact">
<!-- <intent android:targetPackage="dev.lucalewin.planer" android:targetClass="dev.lucalewin.planer.AboutActivity" />-->
</de.dlyt.yanndroid.oneui.preference.PreferenceScreen>
</de.dlyt.yanndroid.oneui.preference.PreferenceCategory>



<PreferenceCategory
android:key="spacing1" />

Expand Down

0 comments on commit f52d4bf

Please sign in to comment.