å¤è¨èªå¯¾å¿ã¢ããªã®éçºã¯é常ã«å¤§å¤ã ãç¹ã«ãã¢ããªå ã§ä½¿ç¨ãããå種ããã¹ãã管çãããæååãªã½ã¼ã¹ãã®åãæ±ãã«ã¤ãã¦ã¯ãæ´æ°ãæ¤è¨¼ã«å¤å¤§ãªå´åãè¦ããããã®èª²é¡ã解決ããããã«ãcsv2strings ã¨ããã¹ã¯ãªãããå ¬éããã
csv2strings ã¯ãGoogleããã¥ã¡ã³ãã®ã¹ãã¬ããã·ã¼ããå©ç¨ããiOSç¨ã® Localizable.strings
㨠Androidç¨ã® strings.xml
ã¨ãããã¼ã«ã©ã¤ãºãã¡ã¤ã«ãèªåçæããRuby製ã®ãã¼ã«ã ã
2019å¹´7æãååã®ããã°è¨äºã§ãåæ§ã®ãã¼ã«ãç´¹ä»ãããããããæ§ãã¼ã¸ã§ã³ã®ãã¼ã«ã¯Swiftã使ã£ã¦ãããããã³ã¼ãã®å¤æ´ãã¨ã«ã³ã³ãã¤ã«ãå¿ è¦ã§ãç·¨éä½æ¥ãç ©éã ã£ãã
æ°ããå ¬éããRubyçã®å©ç¹ã¯ãã³ã¼ãã®ä¿®æ£ã容æã§ãããã¨ãããã¦macOSã ãã§ãªãä»ã®OSã§ãåä½ããç¹ã«ãããç¹ã«CIãµã¼ãã¹ã§ã¯ãAndroidã¢ããªã®éçºç°å¢ã¨ãã¦ããUbuntuã使ç¨ããããã以åã®macOSå°ç¨ã®ãã¤ããªå½¢å¼ã¯ãã®ç°å¢ã§ã¯åããªãã£ãã
iOSã¢ããªéçºã«ä¸å¯æ¬ ãªã©ã¤ãã©ãªç®¡çãã¼ã«ãCocoaPodsãã¯Rubyã§åä½ãããããå¤ãã®éçºè ã¯æ¢ã«Rubyç°å¢ãæ§ç¯æ¸ã¿ã§ãããUbuntuä¸ã§ãRubyã¯æ¨æºçã«å©ç¨ã§ããããã追å ã§ç¹å¥ãªã¤ã³ã¹ãã¼ã«ãè¡ãå¿ è¦ã¯ãªãã
æååãªã½ã¼ã¹ã®èªåçæã®èæ¯
ããããæååãªã½ã¼ã¹ã®èªåçæãå§ããèæ¯ã¨ãã¦ã¯ãããããã¸ã§ã¯ãã§å¯¾å¿ããè¨èªãæ¥ã«7ã¤ã«å¢ããçµé¨ã«ããã
ãã¨ãã¨æ¥æ¬èªã®ã¿å¯¾å¿ã®ã¢ããªã ã£ããã®ããå½éå¸å ´ã«é²åºãããããè±èªãéå½èªãä¸å½èªï¼ç¹ä½ã»ç°¡ä½ï¼ããã¤ãèªãã¤ã¿ãªã¢èªããã©ã³ã¹èªã«ã対å¿ãããã¨ã«ãªã£ãã
ããã¾ã§ã¯ãLocalizable.strings
㨠strings.xml
ã®ä½æãæåã§è¡ã£ã¦ãããããããã®æè¨ãå¤é¨ã®ç¿»è¨³ãµã¼ãã¹ã«ä¾é ¼ããã¨ã¯ã»ã«ã·ã¼ãã§åãåã£ãå¾ãä¸ã¤ä¸ã¤æä½æ¥ã§ã³ãã¼ï¼ãã¼ã¹ãããä½æ¥ã¯ãå¹çãæªããã¹ãå¤çºãã¦ããã
ç¹ã«è±èªä»¥å¤ã®è¨èªã§ã®åºå¥ãé£ãããã³ãããã¹ãèµ·ãããããç¶æ³ã ã£ãããããã¼ã ã§ã¢ã¯ã»ã¹å¯è½ãªGoogleããã¥ã¡ã³ãã®ã¹ãã¬ããã·ã¼ãã«æ å ±ãéç´ããããããiOS/Androidã®ãã¼ã«ã©ã¤ãºãã¡ã¤ã«ãèªåçæããæ¹æ³ãå°å ¥ããã
ãã¼ã«ã®ä½¿ç¨æ¹æ³
ãcsv2stringsãã¯ãGoogle Docsã®ã¹ãã¬ããã·ã¼ãã«è¨å
¥ãããæ
å ±ãcsvå½¢å¼ã§ãã¦ã³ãã¼ããããããåºã« Localizable.strings
㨠strings.xml
ãçæãããæ©æ¢°çã«å®è¡ããããããä½æ¥ã®å¹çåã«å¯ä¸ãã¨ã©ã¼ãæ¸ãããã¨ãã§ããã
å ·ä½çãªä½¿ç¨ä¾ã以ä¸ã«ç¤ºããGoogle Docsã«æ´æ°ãããããã¹ããå«ãcsvãã¡ã¤ã«ããã¦ã³ãã¼ãããããã使ç¨ãã¦ãã¼ã«ã©ã¤ãºãã¡ã¤ã«ãçæãããã¦ã¢ããªã®å¯¾å¿ãããã£ã¬ã¯ããªã«ãããã®ãã¡ã¤ã«ãã³ãã¼ãã¦ããã
# Google Docsããcsvããã¦ã³ãã¼ããã curl -L "https://docs.google.com/spreadsheets/{GUID}&output=csv" -o "${ENV_RESOURCES_DIR}strings/string.csv" sleep 5 # csvããæååãªã½ã¼ã¹ãçæ ruby csv2strings "${ENV_RESOURCES_DIR}strings/string.csv" "${ENV_RESOURCES_DIR}strings/" # ã¢ããªã¸å±é cp $ENV_RESOURCES_DIR/strings/ios/ja/Localizable.strings $PROJECT_DIR/ios/ptcgnote/Resource/ja.lproj/Localizable.strings
ãã®ã¹ã¯ãªããã使ç¨ãããã¨ã§ãæè¨ã®å¤æ´ãå¤è¨èªå¯¾å¿ãæ©æ¢°çã«ããã¤å¹ççã«è¡ããããã«ãªããã¢ããªéçºã®ããã»ã¹ãå¤§å¹ ã«ç°¡ç´ åã§ããã
é¢é£è¨äº
éå»ã®æ稿ã§ç´¹ä»ããcsv2stringsã®åæãã¼ã¸ã§ã³ã