Skip to content

Commit

Permalink
localization scripts (folder) optimization
Browse files Browse the repository at this point in the history
fix cgeo#8050

- add readme
- fix: findmissintraslations does not work with languages whose abbreviation is longer than 2 characters
- add as known false positives in readme (wont fix): findextratranslations finds 2 entries that are correct and therefore should not have been found
  • Loading branch information
bekuno authored and moving-bits committed Jan 4, 2020
1 parent c2c6097 commit 5352118
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main/project/localization/findmissingtranslations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ usage() {
exit 1
}

alllangs=`find ../../res/values-* -name "strings.xml" | sed "s/^.*values-\(..\).*$/ \1/"`
alllangs=`find ../../res/values-* -name "strings.xml" | sed "s/^.*values-\(.*\)\/.*$/ \1/"`

if [ $# -ne 1 ]; then
usage
Expand Down
31 changes: 31 additions & 0 deletions main/project/localization/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Checks for installed languages
==============================

These scripts are only relevant if you are not sure whether the crowdin translations are up-to-date.

* findmissingtranslations.sh

Search of missing translation strings in the language files other than English.
Creates a file <lang>.missing for all checked languages in this directory.

Parameter:
* all check all languages
* <lang> check a dedicated language


* findextratranslations.sh

Search of redundant strings in

Parameter:
* -n only display
* -f: force unused strings removal

Known false positives:
* auth_connected:
* settings_reauthorize:
Both defined in SettingsActivity.java, but not covered by the regex because of ternary operator (?:) before
Sample:
.setSummary(getString(hasToken
? R.string.auth_connected
: R.string.auth_unconnected));

0 comments on commit 5352118

Please sign in to comment.