Explorar o código

handling support if language does not exists

tobiaskaminsky %!s(int64=7) %!d(string=hai) anos
pai
achega
f9b288e990
Modificáronse 2 ficheiros con 10 adicións e 6 borrados
  1. 2 2
      fastlane/Screengrabfile
  2. 8 4
      scripts/screenshots/addMockDevice.sh

+ 2 - 2
fastlane/Screengrabfile

@@ -1,8 +1,8 @@
 app_package_name 'com.nextcloud.client'
 use_tests_in_packages ['com.owncloud.android.screenshots']
 
-app_apk_path 'build/outputs/apk/generic/debug/android-generic-debug.apk'
-tests_apk_path 'build/outputs/apk/androidTest/generic/debug/android-generic-debug-androidTest.apk'
+app_apk_path 'build/outputs/apk/generic/debug/android2-generic-debug.apk'
+tests_apk_path 'build/outputs/apk/androidTest/generic/debug/android2-generic-debug-androidTest.apk'
 
 # locales ['en-US']
 locales ['en-US', 'de-DE', 'en-GB', 'fr-FR', 'it-IT', 'pt-BR', 'pt-PT', 'sv-SE', 'sq-AL', 'sq-MK', 'iw-IL', 'ar-AR', 'bg-BG', 'da-DK', 'fi-FI', 'gl-ES', 'hu-HU', 'tr-TR', 'uk-UK', 'vi-VI', 'ro-RO', 'ru-RU', 'sr-SR', 'pl-PL', 'el-GR', 'ko-KR', 'nl-NL', 'ja-JP', 'no-NO', 'eu-ES', 'lt-LT', 'es-ES', 'es-419', 'zh-HK', 'zk-CN', 'is-IS', 'sr-SR', 'id-ID', 'cs-CZ', 'sl-SL', 'fa-FA' ]

+ 8 - 4
scripts/screenshots/addMockDevice.sh

@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 cd scripts/screenshots/
 for i in $(find ../../fastlane | grep png) ; do 
@@ -12,13 +12,17 @@ for i in $(find ../../fastlane | grep png) ; do
             locale=""
             ;;
         *)
-            locale="-"+$locale
+            locale="-"$locale
     esac
     
-    text=$(grep $textID ../../src/main/res/values$locale/strings.xml | cut -d">" -f2 | cut -d"<" -f1 | sed s'#\&amp;#\\&#')
+    if [ -e ../../src/main/res/values$locale/strings.xml ] ; then
+        text=$(grep $textID ../../src/main/res/values$locale/strings.xml | cut -d">" -f2 | cut -d"<" -f1 | sed s'#\&amp;#\\&#')
+    else
+        text=""
+    fi
     
     # fallback to english if there is not translation
-    if [ $text == "" ]; then
+    if [ -n $text ]; then
         text=$(grep $textID ../../src/main/res/values/strings.xml | cut -d">" -f2 | cut -d"<" -f1 | sed s'#\&amp;#\\&#')
     fi