From a7681b5eb9c8199ba243d3efa3aacc0077320bbe Mon Sep 17 00:00:00 2001 From: Arsentiy Milchakov Date: Mon, 24 Sep 2018 13:19:17 +0300 Subject: [PATCH] [strings] strings.txt is moved to data/strings path --- partners_strings.txt => data/strings/partners_strings.txt | 0 strings.txt => data/strings/strings.txt | 0 data/{ => strings}/types_strings.txt | 0 tools/python/clean_strings_txt.py | 2 +- tools/python/find_untranslated_strings.py | 2 +- tools/python_tests/permissions_test.py | 1 - tools/ruby/category_consistency/check_consistency.rb | 2 +- tools/unix/generate_localizations.sh | 5 +++-- 8 files changed, 6 insertions(+), 6 deletions(-) rename partners_strings.txt => data/strings/partners_strings.txt (100%) rename strings.txt => data/strings/strings.txt (100%) rename data/{ => strings}/types_strings.txt (100%) diff --git a/partners_strings.txt b/data/strings/partners_strings.txt similarity index 100% rename from partners_strings.txt rename to data/strings/partners_strings.txt diff --git a/strings.txt b/data/strings/strings.txt similarity index 100% rename from strings.txt rename to data/strings/strings.txt diff --git a/data/types_strings.txt b/data/strings/types_strings.txt similarity index 100% rename from data/types_strings.txt rename to data/strings/types_strings.txt diff --git a/tools/python/clean_strings_txt.py b/tools/python/clean_strings_txt.py index 2d0942575c..0c3c56e093 100755 --- a/tools/python/clean_strings_txt.py +++ b/tools/python/clean_strings_txt.py @@ -154,7 +154,7 @@ def get_args(): parser.add_argument( "-o", "--output", - dest="output", default="strings.txt", + dest="output", default="data/strings/strings.txt", help="""The name for the resulting file. It will be saved to the project folder. Only relevant if the -s option is set.""" ) diff --git a/tools/python/find_untranslated_strings.py b/tools/python/find_untranslated_strings.py index 99345a2783..402d09b315 100755 --- a/tools/python/find_untranslated_strings.py +++ b/tools/python/find_untranslated_strings.py @@ -23,7 +23,7 @@ class StringsTxt: def __init__(self, strings_path=None): if not strings_path: - self.strings_path = join(dirname(argv[0]), "..", "..", "strings.txt") + self.strings_path = join(dirname(argv[0]), "..", "..", "data","strings", "strings.txt") else: self.strings_path = strings_path diff --git a/tools/python_tests/permissions_test.py b/tools/python_tests/permissions_test.py index 7ea69b210d..a825cda315 100755 --- a/tools/python_tests/permissions_test.py +++ b/tools/python_tests/permissions_test.py @@ -83,7 +83,6 @@ class TestPermissions(unittest.TestCase): def contains_correct_files(self, my_path): dir_contents = listdir(my_path) return ( - "strings.txt" in dir_contents or "android" in dir_contents or "drape_frontend" in dir_contents ) diff --git a/tools/ruby/category_consistency/check_consistency.rb b/tools/ruby/category_consistency/check_consistency.rb index 6558cdd61e..f94dd030e5 100755 --- a/tools/ruby/category_consistency/check_consistency.rb +++ b/tools/ruby/category_consistency/check_consistency.rb @@ -6,7 +6,7 @@ ROOT = File.expand_path(File.dirname(__FILE__)) OMIM_ROOT = File.join(ROOT, '..', '..', '..') CPP_CATEGORIES_FILENAME = File.join(OMIM_ROOT, 'search', 'displayed_categories.cpp') CATEGORIES_FILENAME = File.join(OMIM_ROOT, 'data', 'categories.txt') -STRINGS_FILENAME = File.join(OMIM_ROOT, 'strings.txt') +STRINGS_FILENAME = File.join(OMIM_ROOT, 'data', 'strings', 'strings.txt') CATEGORIES_MATCHER = /m_keys = \{(.*)\};/m def load_categories_from_cpp(filename) diff --git a/tools/unix/generate_localizations.sh b/tools/unix/generate_localizations.sh index 60b5b23645..97f537dc6b 100755 --- a/tools/unix/generate_localizations.sh +++ b/tools/unix/generate_localizations.sh @@ -3,9 +3,10 @@ set -e -u -x OMIM_PATH="$(dirname "$0")/../.." TWINE="$OMIM_PATH/tools/twine/twine" +STRINGS_PATH="$OMIM_PATH/data/strings" MERGED_FILE="$(mktemp)" -cat "$OMIM_PATH/strings.txt" "$OMIM_PATH/partners_strings.txt" "$OMIM_PATH/data/types_strings.txt" > "$MERGED_FILE" +cat "$STRINGS_PATH/strings.txt" "$STRINGS_PATH/partners_strings.txt" "$STRINGS_PATH/types_strings.txt" > "$MERGED_FILE" # TODO: Add "--untagged --tags android" when tags are properly set. # TODO: Add validate-strings-file call to check for duplicates (and avoid Android build errors) when tags are properly set. @@ -16,6 +17,6 @@ $TWINE generate-all-localization-files --format apple --file-name InfoPlist.stri $TWINE generate-all-localization-files --format jquery "$OMIM_PATH/data/cuisines.txt" "$OMIM_PATH/data/cuisine-strings/" $TWINE generate-all-localization-files --format jquery "$OMIM_PATH/data/countries_names.txt" "$OMIM_PATH/data/countries-strings/" $TWINE generate-all-localization-files --format jquery "$OMIM_PATH/data/sound.txt" "$OMIM_PATH/data/sound-strings/" -#$TWINE generate-all-localization-files --include translated --format tizen "$OMIM_PATH/strings.txt" "$OMIM_PATH/tizen/MapsWithMe/res/" --tags tizen +#$TWINE generate-all-localization-files --include translated --format tizen "$STRINGS_PATH/strings.txt" "$OMIM_PATH/tizen/MapsWithMe/res/" --tags tizen rm $MERGED_FILE