Open Source i18n-ally now supports SAP UI5 in VS Code

 

Recently I found that there is an all powerful i18n extension for VS Code called i18n-ally. It has support for many frameworks, but SAP UI5 was not on the list and here I am writing this blog as it supports SAP UI5 now 🙂

 

 

Why I say i18n-ally is all powerful? It supports-

  1. Inline annotations
  2. Machine translation
  3. Hover and edit translation
  4. Editor UI, with missing translation usage report and much more..

I’ll just stop writing and let’s look at the below video.

 

Git Hub Repo: https://github.com/antfu/i18n-ally

 

To use it for UI5 application in VSCode, just add the below in .vscode settings.json

{
"i18n-ally.enabledFrameworks": [
    "ui5"
]
}

or if the package.json file has the “@ui5/cli”  devDependenies, then also i18n-ally recognises it as a UI5 framework.

 

 

Although I haven’t developed this extension from the scratch, I only provided the support for SAP UI5 and it was also easily extendable as Anthony Fu did a great job designing it well and many thanks to Anthony for creating this wonderful extension!

 

So don’t wait anymore, go a head and install the plugin from vs code marketplace

https://marketplace.visualstudio.com/items?itemName=antfu.i18n-ally

 

Note before using the extension:

  1. Default i18n.properties will not be considered, only i18n_locale.properties files are considered.
  2. Comments are also excluded, even if there are any existing comments, they will be removed once you start using i18n ally. Who needs comments in i18n anyway? 😀 JK, if anyone is interested, we can provide support for it 🙂

 

Update: more information reg. the usage of the plugin

Framework supported matches, that will automatically fetch i18n values and show it as annotations

'\\{(i18n>{key})\\}',
'getResourceBundle\\(\\)\\.getText\\([\'"`]({key})[\'"`]'

If you want to add more, add like below in the settings.json file

"i18n-ally.regex.usageMatchAppend": [ "getText\\([\\'\"]({key})[\\'\"]" ]

 

Annotations will be shown in .js and .xml files (currently).

 

If your i18n files are in different folders, use the below setting

"i18n-ally.localesPaths": "webapp/i18n"

 

for more information check here:

https://github.com/antfu/i18n-ally/wiki/Configurations

 

 

Have fun!

-Mahesh

Original Article:
https://blogs.sap.com/2020/05/06/open-source-i18n-ally-now-supports-sap-ui5-in-vs-code/

ASK SAP EXPERTS ONLINE
Related blogs

LEAVE A REPLY

Please enter your comment!
Please enter your name here