How can I identify unused i18n keys?

后端 未结 5 1617
萌比男神i
萌比男神i 2021-02-04 03:42

I\'m working on an existing Rails app and am using a localization file, en.yml, to hold most of the app\'s text. At the moment, we aren\'t localizing into any other

5条回答
  •  不知归路
    2021-02-04 04:18

    Get the ones that are actively used, then remove the rest. That's what I use.

    Actually I set them to active=0 but that may not work for you

    Update
    Turns out I was unclear.

    There are two ways to look at this: from the source files or from the translation files. If you look from the source files you need to identify all strings that are in use and finally remove all unused strings.

    If you look from the translation files, you need to look at the source and determine whether they are still used, as you mentioned in the question.

    There's no other way.

提交回复
热议问题