Is it possible to update a localized storyboard's strings?

前端 未结 14 1292
星月不相逢
星月不相逢 2020-11-28 00:13

I localized a part of my application with creating a base.lproj storyboard and 3 string files for it. It was a month ago and after that I added new view controller to app, b

14条回答
  •  渐次进展
    2020-11-28 00:50

    Check out BartyCrouch, it perfectly solves your problem. Also it is open source, actively maintained and can be easily installed and integrated within your project.


    Install BartyCrouch via Homebrew:

    brew install bartycrouch
    

    Alternatively, install it via Mint:

    mint install Flinesoft/BartyCrouch
    

    Incrementally update your Storyboards/XIBs Strings files:

    $ bartycrouch update
    

    This will do exactly what you were looking for.


    In order to keep your Storyboards/XIBs Strings files updated over time I highly recommend adding a build script (instructions on how to add a build script here):

    if which bartycrouch > /dev/null; then
        bartycrouch update -x
        bartycrouch lint -x
    else
        echo "warning: BartyCrouch not installed, download it from https://github.com/Flinesoft/BartyCrouch"
    fi
    

    In addition to incrementally updating your Storyboards/XIBs Strings files this will also make sure your Localizable.strings files stay updated with newly added keys in code using NSLocalizedString and show warnings for duplicate keys or empty values.

    Make sure to checkout BartyCrouch on GitHub or this detailed article for additional information.

提交回复
热议问题