diff options
author | filip <filip.komar@gmail.com> | 2013-11-03 21:23:31 +0100 |
---|---|---|
committer | filip <filip.komar@gmail.com> | 2013-11-03 21:23:31 +0100 |
commit | 3c62c98c97ec390a3a64b100a1deef911951cb14 (patch) | |
tree | b403b6fb3a4f6f943cd9fa06f7cfd66f95195b12 /check_for_translation_work.sh | |
parent | 7c7e064f4536263c0a7e00fe6c5b73a86978e5f3 (diff) | |
download | tools-3c62c98c97ec390a3a64b100a1deef911951cb14.tar tools-3c62c98c97ec390a3a64b100a1deef911951cb14.tar.gz tools-3c62c98c97ec390a3a64b100a1deef911951cb14.tar.bz2 tools-3c62c98c97ec390a3a64b100a1deef911951cb14.tar.xz tools-3c62c98c97ec390a3a64b100a1deef911951cb14.zip |
added warning and test for GenericName
added warning about configuration excluding the work on desktop files in list_of_resources_for_translation.txt
added test for GenericName for *.desktop file
Diffstat (limited to 'check_for_translation_work.sh')
-rwxr-xr-x | check_for_translation_work.sh | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/check_for_translation_work.sh b/check_for_translation_work.sh index 55b31256..ee6a6089 100755 --- a/check_for_translation_work.sh +++ b/check_for_translation_work.sh @@ -7,7 +7,7 @@ # # Filip Komar, 2012, 2013 # Remco Rijnders, 2012 -# $Id: check_for_translation_work.sh 2013-11-02 20:16:00 UTC filip $ +# $Id: check_for_translation_work.sh 2013-11-03 20:17:00 UTC filip $ # # Please see git for a list of changes to this script. # @@ -444,6 +444,7 @@ echo "" >> "$log_directory"/list_of_resources_for_translation.txt echo "*.desktop files:" | tee -a "$logfile"_this_run.log echo "Translate *.desktop files in working directories ($working_translations_directory/desktop/$translate_project_name_desktop):" >> "$log_directory"/list_of_resources_for_translation.txt echo -e "\E[m" +empty_list_of_desktop_file="" for translate_project_name_desktop in "${!translate_projects_desktop[@]}" do if [ ! -f "$git_directory/${translate_projects_desktop[$translate_project_name_desktop]}" ]; then @@ -456,6 +457,7 @@ do copy_this_desktop_file="no" untranslated_name="Name, " untranslated_comment="Comment," + untranslated_generic_name="GenericName, " names_and_comments="" echo "Working on *.desktop file in working translations directory: $translate_project_name_desktop and local git directory: ${translate_projects_desktop[$translate_project_name_desktop]}." | tee -a "$logfile"_this_run.log # cd "$git_directory/${translate_projects_desktop[$translate_project_name_desktop]}/" # $translate_project_name_desktop" @@ -465,6 +467,8 @@ do lang_name=`echo "$names_and_comments" | grep -E "^Name\[$language_code\]=" | sed 's/^Name\['$language_code'\]=//'` eng_comment=`echo "$names_and_comments" | grep -E "^Comment=" | sed 's/^Comment=//'` lang_comment=`echo "$names_and_comments" | grep -E "^Comment\[$language_code\]=" | sed 's/^Comment\['$language_code'\]=//'` + eng_generic_name=`echo "$names_and_comments" | grep -E "^GenericName=" | sed 's/^GenericName=//'` + lang_generic_name=`echo "$names_and_comments" | grep -E "^GenericName\[$language_code\]=" | sed 's/^GenericName\['$language_code'\]=//'` if [ -n "$eng_name" ]; then # Name string present in original desktop file if [ -n "$lang_name" ]; then # Name string present in your language @@ -496,6 +500,21 @@ do echo Comment string \"$eng_comment\" not present in $language_code language | tee -a "$logfile"_this_run.log fi fi + if [ -n "$eng_generic_name" ]; then # GenericName string present in original desktop file + if [ -n "$lang_generic_name" ]; then # GenericName string present in your language + if [ "$lang_generic_name" != "$eng_generic_name" ]; then # both strings differ +# echo GenericName string \"$eng_generic_name\" in $language_code language present: \"$lang_generic_name\" # debug +# echo -n # nop + untranslated_generic_name="" + else # both strings are equal + copy_this_desktop_file="yes" + echo GenericName string \"$eng_generic_name\" in $language_code language present but untranslated | tee -a "$logfile"_this_run.log + fi + else # GenericName string not present in your language + copy_this_desktop_file="yes" + echo GenericName string \"$eng_generic_name\" not present in $language_code language | tee -a "$logfile"_this_run.log + fi + fi # copying the *.desktop file for editing in working directory if required if [ -z $copying_desktop_files ]; then @@ -507,9 +526,17 @@ do fi fi if [ "$copy_this_desktop_file" = "yes" ]; then - echo $translate_project_name_desktop, untranslated line: $untranslated_name $untranslated_comment >> "$log_directory"/list_of_resources_for_translation.txt + echo $translate_project_name_desktop, untranslated line: $untranslated_name $untranslated_comment $untranslated_generic_name >> "$log_directory"/list_of_resources_for_translation.txt + empty_list_of_desktop_file="no" fi done +if [ -n "$work_on_desktop_files" ]; then + echo Your configuration exclude work on desktop files >> "$log_directory"/list_of_resources_for_translation.txt +else + if [ -z "$empty_list_of_desktop_file" ]; then + echo Congratulations. All desktop files are translated in $language_code language. >> "$log_directory"/list_of_resources_for_translation.txt + fi +fi if [ -z "$work_on_web_pages_translation" ]; then # Check out / update web_page files |