Search code examples
internationalizationsapui5webstorm

How to automatic search and replace for 18n.properties file with WebStorm


For SAPUI5 there are i18n.properties files.

For the German language I need to replace the special German chars with the unicode codes.

# AE = \u00C4, ae = \u00E4
# OE = \u00D6, oe = \u00F6
# UE = \u00DC, ue = \u00FC
# SZ = \u00DF

How can I automate this search and replace with WebStorm?


Solution

  • You could just use WebStorms 'Replace in Path' (CMD+SHIFT+R on Mac) on your i18n folder. IntelliJ IDEA has better editing support for .properties files though (since they are coming from java)

    Will be also easy to do this via a node script/bash script/gulp task whatsoever.

    Btw: Is this really needed? Having all .properties files in UTF-8 should just do the trick. Afaik only Tomcat got confused by that since in the Java spec these files are ISO-8859-1 by definition. As long as you are deploying to a platform that accepts them as UTF-8 there shouldn't be an issue.

    BR Chris

    PS: That code looks really familiar ;D