Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
maheshpalavalli
Active Contributor


 

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
17 Comments
Labels in this area