Package: gslocalizator
Quick StartInstallpip3 install gslocalizatorUsing#!/usr/bin/env pythonfromgslocalizatorimportGoogleSheetLocalizatorasGSLrfromcfgimport*defmain():withGSLr(GSL_CREDS_FILE,GSL_SPREADSHEET_ID)asgslr:gslr.tran(from_sheet_range='main!A1:E',with_key_column='iOS（IM）Key',from_value_column_to_file={'zh-Hans':'.datas/ios/strings_main/zh-Hans.lproj/Localizable.strings','zh-Hant':'.datas/ios/strings_main/zh-Hant.lproj/Localizable.strings','en':'.datas/ios/strings_main/en.lproj/Localizable.strings','ja':'.datas/ios/strings_main/ja.lproj/Localizable.strings',},exclude_headers=['//']).request().save(format="iOS")if__name__=='__main__':main()cell formaterCell formater used to format cells in the spreadsheet.for example:title of keytitle of lang1title of lang2...HelloHello您好hhhhworldworld世界wwwwkey_formater  only be used to cells that under "title of key".You can custom your formater for keys and cellsdefcell_fmter(val:str)->str:returnre.sub("\s+"," ",val).strip().replace("%s","%@").replace("\"","\\\"")defkey_fmter(val:str)->str:returnre.sub("\s+"," ",val).strip().replace("%s","%@")defload():# ...withGSLr(GSL_CREDS_FILE,GSL_SPREADSHEET_ID)asgslr:gslr.tran(from_sheet_range='bizA!A1:F',with_key_column='key',from_value_column_to_file={'zh-Hans':'.datas/ios/strings_biz_a/zh-Hans.lproj/Localizable.strings','zh-Hant':'.datas/ios/strings_biz_a/zh-Hant.lproj/Localizable.strings','en':'.datas/ios/strings_biz_a/en.lproj/Localizable.strings','ja':'.datas/ios/strings_biz_a/ja.lproj/Localizable.strings',},exclude_headers=['//'],cell_formater=cell_fmter).request().save(format="iOS")# ...# replace "'" to "\'" demodefcell_fmter(val:str)->str:aVal=re.sub('\w(\')',lambdax:x.group(1),val)# replace "'" to "\'"returnre.sub("\s+"," ",aVal).strip().replace("%s","%@").replace("\"","\\\"")You can merge diffrent sheets to one file.Sheet "bizA" and sheet "main" merge to "app/***/strings.xml"defrequest_android(gslr:GSLr):gslr.reset()gslr.tran(from_sheet_range='bizA!A1:E',with_key_column='key',from_value_column_to_file={'zh-Hans':'.datas/android/app/values-zh-rCN/strings.xml','zh-Hant':'.datas/android/app/values-zh-rTWj/strings.xml','en':'.datas/android/app/values/strings.xml','ja':'.datas/android/app/values-ja-rJP/strings.xml',},exclude_headers=['//'],cell_formater=cell_fmter,key_formater=key_fmter).tran(from_sheet_range='main!A1:E',with_key_column='iOS（IM）Key',from_value_column_to_file={'zh-Hans':'.datas/android/app/values-zh-rCN/strings.xml','zh-Hant':'.datas/android/app/values-zh-rTWj/strings.xml','en':'.datas/android/app/values/strings.xml','ja':'.datas/android/app/values-ja-rJP/strings.xml',},exclude_headers=['//']).request().save(format="Android")Or you can write diff sheets to their own files.Sheet "bizA" save to "strings_biz_a/***/strings.xml"Sheet "main" save to "strings_main/***/strings.xml"defrequest_android(gslr:GSLr):gslr.reset()gslr.tran(from_sheet_range='bizA!A1:E',with_key_column='key',from_value_column_to_file={'zh-Hans':'.datas/android/strings_biz_a/values-zh-rCN/strings.xml','zh-Hant':'.datas/android/strings_biz_a/values-zh-rTWj/strings.xml','en':'.datas/android/strings_biz_a/values/strings.xml','ja':'.datas/android/strings_biz_a/values-ja-rJP/strings.xml',},exclude_headers=['//'],cell_formater=cell_fmter,key_formater=key_fmter).tran(from_sheet_range='main!A1:E',with_key_column='iOS（IM）Key',from_value_column_to_file={'zh-Hans':'.datas/android/strings_main/values-zh-rCN/strings.xml','zh-Hant':'.datas/android/strings_main/values-zh-rTWj/strings.xml','en':'.datas/android/strings_main/values/strings.xml','ja':'.datas/android/strings_main/values-ja-rJP/strings.xml',},exclude_headers=['//']).request().save(format="Android")