Fix custom filter placeholders

pull/493/head
Alex Baker 8 years ago
parent 17d3c420b8
commit af7ea3fd05

@ -9,7 +9,6 @@ package com.todoroo.andlib.test;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.support.test.runner.AndroidJUnit4;
import android.support.v4.text.TextUtilsCompat;
import com.todoroo.andlib.data.Callback;
@ -23,7 +22,6 @@ import java.util.List;
import java.util.Locale;
import static android.support.test.InstrumentationRegistry.getTargetContext;
import static android.support.v4.view.ViewCompat.LAYOUT_DIRECTION_LTR;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
@ -201,9 +199,8 @@ public class TranslationTests {
* check if string contains contains substrings
*/
private void contains(Resources r, int resource, StringBuilder failures, String expected) {
String base = getTargetContext().getResources().getString(resource);
String translation = r.getString(resource);
if(!base.equals(translation) && !translation.contains(expected)) {
if(!translation.contains(expected)) {
Locale locale = r.getConfiguration().locale;
String name = r.getResourceName(resource);
failures.append(String.format("%s: %s did not contain: %s\n",
@ -219,13 +216,11 @@ public class TranslationTests {
final StringBuilder failures = new StringBuilder();
forEachLocale(r -> {
int layoutDirection = TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault());
String expected = layoutDirection == LAYOUT_DIRECTION_LTR ? "?" : "؟";
contains(r, R.string.CFC_tag_text, failures, expected);
contains(r, R.string.CFC_title_contains_text, failures, expected);
contains(r, R.string.CFC_dueBefore_text, failures, expected);
contains(r, R.string.CFC_tag_contains_text, failures, expected);
contains(r, R.string.CFC_gtasks_list_text, failures, expected);
contains(r, R.string.CFC_tag_text, failures, "?");
contains(r, R.string.CFC_title_contains_text, failures, "?");
contains(r, R.string.CFC_dueBefore_text, failures, "?");
contains(r, R.string.CFC_tag_contains_text, failures, "?");
contains(r, R.string.CFC_gtasks_list_text, failures, "?");
});
assertEquals(failures.toString(), 0,

@ -82,14 +82,13 @@
<string name="CFA_context_delete">حذف الصف</string>
<string name="CFA_help">ضغط مطول على الموضوع من أجل خيارات إضافية</string>
<string name="CFA_button_add">إضافة معايير</string>
<string name="CFC_dueBefore_text">مستحق بحسب :؟</string>
<string name="CFC_dueBefore_text">مستحق بحسب :?</string>
<string name="next_month">الشهر القادم</string>
<string name="CFC_importance_text">أولوية على الأقل</string>
<string name="CFC_title_contains_name">العنوان يحتوي على..</string>
<string name="CFC_title_contains_text">العنوان يحتوي على :؟</string>
<string name="CFC_title_contains_text">العنوان يحتوي على :?</string>
<string name="gcal_TEA_addToCalendar_label">أضف إلى التقويم</string>
<string name="gcal_TEA_showCalendar_label">إفتح أحداث التقويم</string>
<string name="CFC_gtasks_list_text">في القائمة</string>
<string name="CFC_gtasks_list_text">في القائمة :?</string>
<string name="gtasks_GTA_clear_completed">انتهاء الحذف</string>
<string name="gtasks_GLA_noaccounts">لا يوجد حساب قوقل للتزامن مع.</string>
<string name="gtasks_GLA_errorIOAuth">عذرا، لم نتمكن من الاتصال مع خادم قوقل. أعد المحاولة مرة أخرى لاحقا.</string>

@ -130,7 +130,7 @@
<string name="gcal_TEA_addToCalendar_label">Προσθήκη στο ημερολόγιο</string>
<string name="gcal_TEA_showCalendar_label">Άνοιγμα event ημερολογίου</string>
<string name="gcal_completed_title">%s (έχει ολοκληρωθεί)</string>
<string name="CFC_gtasks_list_text">Στην λίστα: ;</string>
<string name="CFC_gtasks_list_text">Στην λίστα: ?</string>
<string name="CFC_gtasks_list_name">Στην λίστα του GTasks...</string>
<string name="gtasks_GTA_clear_completed">Καθαρισμός ολοκληρωμένων</string>
<string name="gtasks_GLA_noaccounts">Δεν υπάρχουν λογαριασμοί Google για συγχρονισμο.</string>

Loading…
Cancel
Save