Search code examples
resxmultilingual-app-toolkit

Is it possible to refactor string keys when using the Multilingual App Toolkit?


When using the Multilingual App Toolkit (MAT) v4, refactoring a string ID in a reference to a resx string will, as expected, change the ID of that string in all resx files. However, the xlf files are not touched, and when you recompile, MAT will 1) detect the refactored ID as a new string resource, and 2) remove the "old" string resource since it's no longer present in the master resx file.

Is it possible to properly (automatically) refactor string keys when using MAT?


Solution

  • The Multilingual App Toolkit does not support refactoring IDs. The resource ID (and source file) is used as the only unique identifier. Using the source string alone is not considered a reliable identifier alone

    the XLF files are updated during the build operation, which is why you see the new/deleted string(s) after the build.

    As a workaround, after the build you can import the previous XLF files with the recycling option enabled (Check box on the bottom of the Import UI). The recycling option uses the source string (and other check) to match refactor resources. (Of course, you will need to have a copy in source control or else were to set the previous values)