Commit c8dd888a authored by cfabio's avatar cfabio

Fix French translation of period spinner in Settings

parent 496f2ec6
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>
\ No newline at end of file
<component name="CopyrightManager">
<settings default="" />
</component>
\ No newline at end of file
......@@ -5,11 +5,12 @@
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<list size="5">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
......@@ -24,7 +25,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8 (1)" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8 (1)" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -85,48 +85,52 @@ public class SettingsActivity extends AppCompatActivity implements AdapterView.O
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
period = periodSpinner.getSelectedItem().toString();
switch (period) {
case "1 minute":
period = "1";
break;
case "3 minutes":
period = "3";
break;
case "5 minutes":
period = "5";
break;
case "15 minutes":
period = "15";
break;
case "30 minutes":
period = "30";
break;
case "1 "+R.string.hour:
period = "60";
break;
case "2 "+R.string.hours:
period = "120";
break;
case "3 "+R.string.hours:
period = "180";
break;
case "4 "+R.string.hours:
period = "240";
break;
case "1 "+R.string.day:
period = "D";
break;
case "1 "+R.string.week:
period = "W";
break;
case "1 "+R.string.month:
period = "M";
break;
default:
period = DEFAULT_PERIOD;
break;
Log.d("SETTINGS", "period: " + period);
Log.d("SETTINGS", "R.string.hours: " + getResources().getString(R.string.hours));
if ("1 minute".equals(period)) {
period = "1";
} else if ("3 minutes".equals(period)) {
period = "3";
} else if ("5 minutes".equals(period)) {
period = "5";
} else if ("15 minutes".equals(period)) {
period = "15";
} else if ("30 minutes".equals(period)) {
period = "30";
} else if (("1 " + getResources().getString(R.string.hour)).equals(period)) {
period = "60";
} else if (("2 " + getResources().getString(R.string.hours)).equals(period)) {
period = "120";
} else if (("3 " + getResources().getString(R.string.hours)).equals(period)) {
period = "180";
} else if (("4 " + getResources().getString(R.string.hours)).equals(period)) {
period = "240";
} else if (("1 " + getResources().getString(R.string.day)).equals(period)) {
period = "D";
} else if (("1 " + getResources().getString(R.string.week)).equals(period)) {
period = "W";
} else if (("1 " + getResources().getString(R.string.month)).equals(period)) {
period = "M";
} else {
period = DEFAULT_PERIOD;
}
Log.d("SETTINGS", "period2: " + period);
editor.putString("period", period);
editor.commit();
}
......@@ -156,25 +160,25 @@ public class SettingsActivity extends AppCompatActivity implements AdapterView.O
label = "30 minutes";
break;
case "60":
label = "1 hour";
label = "1 " + getResources().getString(R.string.hour);
break;
case "120":
label = "2 hours";
label = "2 " + getResources().getString(R.string.hours);
break;
case "180":
label = "3 hours";
label = "3 " + getResources().getString(R.string.hours);
break;
case "240":
label = "4 hours";
label = "4 " + getResources().getString(R.string.hours);
break;
case "D":
label = "1 day";
label = "1 " + getResources().getString(R.string.day);
break;
case "W":
label = "1 week";
label = "1 " + getResources().getString(R.string.week);
break;
case "M":
label = "1 month";
label = "1 " + getResources().getString(R.string.month);
break;
default:
label = DEFAULT_PERIOD;
......
......@@ -38,9 +38,11 @@
android:id="@+id/period_spinner"
android:layout_width="136dp"
android:layout_height="37dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/currency_switch" />
app:layout_constraintTop_toBottomOf="@+id/currency_switch"
android:layout_marginRight="8dp" />
<TextView
android:id="@+id/about"
......
......@@ -26,9 +26,10 @@
<string name="amountHeld">Solde</string>
<string name="save">Enregistrer</string>
<string name="remove">Supprimer</string>
<string name="cancel">Annuler</string>
<string-array name="period_array">
<item>1 minutes</item>
<item>1 minute</item>
<item>3 minutes</item>
<item>5 minutes</item>
<item>15 minutes</item>
......@@ -41,4 +42,11 @@
<item>1 semaine</item>
<item>1 mois</item>
</string-array>
</resources>
<string name="hour">heure</string>
<string name="hours">heures</string>
<string name="day">jour</string>
<string name="week">semaine</string>
<string name="month">mois</string>
</resources>
\ No newline at end of file
......@@ -24,11 +24,6 @@
\nGet the full source code at <a href="https://gitlab.com/cfabio/AltcoinPrices">gitlab.com</a>
\n\n<a href="https://gitlab.com/cfabio/AltcoinPrices#how-can-i-support-the-developer">Support the developer and send a donation</a>
\n\n<b>Version</b></string>
<string name="hour">hour</string>
<string name="hours">hours</string>
<string name="day">day</string>
<string name="week">week</string>
<string name="month">month</string>
<!-- MAIN -->
<string name="Balance">Balance</string>
......@@ -56,7 +51,7 @@
</string-array>
<string-array name="period_array">
<item>1 minutes</item>
<item>1 minute</item>
<item>3 minutes</item>
<item>5 minutes</item>
<item>15 minutes</item>
......@@ -70,4 +65,10 @@
<item>1 month</item>
</string-array>
<string name="hour">hour</string>
<string name="hours">hours</string>
<string name="day">day</string>
<string name="week">week</string>
<string name="month">month</string>
</resources>
AltcoinPrices @ 34082cbb
Subproject commit 34082cbb77c2b94c5a476d1f27c98cf4c5431cfc
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment