On Wed, Nov 21, 2018 at 7:05 PM Fazlan Nazeem <[email protected]> wrote:

> +1 for the second approach.
>
> On Wed, Nov 21, 2018 at 5:04 PM Ruwini Wijesiri <[email protected]> wrote:
>
>> Hi,
>>
>> We have a requirement to internationalize the text content of widgets. So
>> far we have identified 2 approaches to achieve this;
>>
>>    1. Have a single locale.json file that contains the message id to
>>    text mapping for all locales within the *'resource'* directory of the
>>    widget. However. this will result in the the widget needing to be re-built
>>    whenever a change is made to the locale.json file.
>>
>> Widget need not to be rebuilt in the first approach. You  can have the
locale file at the
HOME/wso2/dashboard/deployment/web-ui-apps/portal/extensions/widgets/<WidgetName>/locales/<locale.json>
 and replace only the locale file when needed.
But the issue I see with the first approach is, we need to support serving
the locale file in the above location by the carbon-ui-server also which is
not supported at the moment AFAIK. @SajithAR : Please correct me if I'm
wrong.

>
>>    1.
>>    2. Have the {locale}.json files in carbon-dashboards and load the
>>    json files to the widget via an API call in the same manner it is done in
>>    the SP portal. Currently, the SP portal locale files are located in
>>    directory *'components/dashboards-web-component/public/locales/'*.
>>    The widget specific locale files could be placed in directory
>>    
>> *'components/dashboards-web-component/public/locales/widgets/{widget_name}/'.
>>  *
>>
>> +1 for the second approach as it already has carbon-ui- server support.

Thanks,
Tanya

> The second approach seems a better alternative as it will eliminates the
>> need to re-build widgets when new locales are added.
>>
>> Any ideas on these 2 approaches or any other approach is highly
>> appreciated.
>>
>> Thanks,
>> Regards,
>> Ruwini.
>> --
>> Ruwini Wijesiri
>> Software Engineer,
>> WSO2 Inc.
>>
>> Mobile : +94716133480
>>
>> <http://wso2.com/signature>
>>
>
>
> --
> Thanks & Regards,
>
> *Fazlan Nazeem*
> Senior Software Engineer
> WSO2 Inc
> Mobile : +94772338839
> [email protected]
>


-- 
*Tanya Madurapperuma* | Associate Technical Lead| WSO2 Inc.
(m) +94718184439 | (e) [email protected]

<http://wso2.com/signature>
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to