Hello Everyone,

In the previous year's Google Summer of Code, we(Ed, Gaurav and I)
initiated a discussion regarding the implementation of translations within
the web-app wherein the various possibilities using which it can be done
was discussed. As talked about in today's meeting I would like to share it
with the community so we could further the discussion on the same.

Angular's Internationalization (https://angular.io/guide/i18n) is an
official library provided by Angular to support translations. But it has a
few drawbacks as of now considering our use case.
1) It does not support runtime translations. That means every time we need
to switch the language we need to rebuild the project which is not
feasible. The project can only be built using a single language at once and
then used.
2) The current translation files in the community-app, as well as the
web-self-service-app, are in JSON format which is not supported by i18n.
The only supported formats are XLIFF or XML. That means we cannot reuse the
existing translations which will be a drawback for the web-app(as it is a
large project with a lot of translations implemented already in community
app) but not as much for the online-banking-app.

On the other hand, there is a 3rd party library called ngx-translate (
https://github.com/ngx-translate/core) which overcomes both these drawbacks
as it allows the use of JSON and supports runtime translation.
But it being a 3rd party library is not officially supported neither
tested(might have bugs or shortcomings) to the extent of Angular's official
packages. That means we don't know for how long it will be kept updated/in
sync to support Angular's updates. Its usage might lead to issues in the
long run. If we decide to use it we will have to discuss the problems
within the library that might lead to bugs and if they could be avoided.

There is an ongoing development by Angular's team to support runtime
translations with the release of ivy. If that is implemented we would have
official support but still, we might not be able to use the existing
translation files unless there is JSON support. However, it is uncertain
when it will be released. Looking at the recent comments in [1], I believe
it isn't happening soon.

References:
[1] https://github.com/angular/angular/issues/16477
[2] https://github.com/ngx-translate/core/issues/783
[3] https://github.com/ngx-translate/core/issues/495

We could further discuss on this so that a decision can be made on how
translations can proceed within the web-app projects.

Thanks,
Abhay.

Reply via email to