Re: [Dev] How can we add multi language support in javascript files

2017-04-24 Thread SajithAR Ariyarathna
Hi Prasanna,

We have implemented server-side JS function for i18n [1]. One can use it as
follows.


i18n("message.key");


i18n("message.key", param1, param2, ...);


This feature is in the current master, will do a milestone release with
this soon.

[1] https://github.com/wso2/carbon-uuf/pull/220


On Tue, Apr 25, 2017 at 10:03 AM, Prasanna Dangalla 
wrote:

> Hi All,
>
> Kind reminder on this. What should we follow to do internationalization
> in javascript code ?
>
> @UUF Team: Shall we come to a final decision regarding this.
>
> Thanks
>
> *Prasanna Dangalla*
> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
> lean.enterprise.middleware
>
>
> *cell: +94 718 11 27 51*
> *twitter: @prasa77*
>
> On Sun, Mar 26, 2017 at 9:50 AM, Ruwan Abeykoon  wrote:
>
>> Hi All,
>> Interesting article about similar requirement[1]
>>
>> [1] http://nerds.airbnb.com/slides-and-video-from-spike-brehms-tech-talk/
>>
>> Cheers,
>> Ruwan
>>
>> On Fri, Mar 24, 2017 at 10:55 PM, Prasanna Dangalla 
>> wrote:
>>
>>>
>>>
>>> On Fri, Mar 24, 2017 at 6:34 PM Manuranga Perera  wrote:
>>>
 We need to bring whole i18n (combined all lang files) to the UI and
 cache it.

>>>
>>> Bringing the whole thing will be an expensive operation in the fist time
>>> before caching them, IMO we should load page wise and then cache them. WDYT
>>> ?
>>>


 On Fri, Mar 24, 2017 at 8:40 AM, Nuwandi Wickramasinghe <
 nuwan...@wso2.com> wrote:



 On Fri, Mar 24, 2017 at 1:49 PM, Nuwan Dias  wrote:



 On Fri, Mar 24, 2017 at 1:23 PM, Ruwan Abeykoon 
 wrote:

 Hi All,
 What if,
 i18n is handled on the server side only, and encode the relevant
 localized strings into HTML by the server-side (js or hbs).
 Client side libraries only read the string values already in the client
 locale within HTML DOM itself and just render the data. No client-side 
 i18n.

 I have a situation where a part of the DOM is created in client side
 JS. In that case this wouldn't work.


 What is would be the limitations?


 Limitations would be for SPAs where the rendering is done at the client
 side. Which would basically mean that SPAs can't have localization.


 Cheers,
 Ruwan

 On Fri, Mar 24, 2017 at 11:54 AM, Nipuna Chandradasa 
 wrote:

 API of somekind(Rest or a http service endpoint), That we have to think
 about,  that exposes a functionality to retrieve i18n as a json object to
 layout level or any other global level of the application. So on client
 side we can use the i18n language details anywhere.
 We can get the language data from the browser.. that's how we do it
 anyway i think. We get the i18n based on the what language browser has
 configured to use.

 Thank you,

 On Fri, Mar 24, 2017 at 10:14 AM, Prasanna Dangalla 
 wrote:

 On Fri, Mar 24, 2017 at 12:53 AM, Nipuna Chandradasa 
 wrote:

 I don't think there is a feasible solution rather than loading i18n
 config file as a json object to the client side in the beginning of the
 app... i think from uuf side we can provide a api for that... WDYT?

 API in the sense, what kind of an API ? Does this loads all the data
 into front end or are you thinking about a filtering mechanism for the
 language data by page before you send them to front end ?


 On Thu, Mar 23, 2017 at 5:29 PM, SajithAR Ariyarathna <
 sajit...@wso2.com> wrote:

 Currently UUF doesn't support i18n in client-side.

 @UUF Team,
 We need to come up with a solution for client-side i18n. Shall we start
 a discussion on this?

 Thanks.


 On Thu, Mar 23, 2017 at 4:36 PM, Prasanna Dangalla 
 wrote:

 Hi Sajith,

 This is for Client-side JS

 *Prasanna Dangalla*
 Senior Software Engineer, WSO2, Inc.; http://wso2.com/
 lean.enterprise.middleware


 *cell: +94 718 11 27 51*
 *twitter: @prasa77*

 On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna <
 sajit...@wso2.com> wrote:

 Hi Prasanna,

 Is there a mechanism defined to use something like i18n in javascript ?

 Server-side JS or Client-side JS?

 On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka 
 wrote:

 Hi Prasanna,

 Similar discussion was started sometime back in [1].
 Issues in [2], [3] have some suggestions.

 [1] [Dev][UUF][IS-6] Enable i18n support in javascript
 [2] https://github.com/wso2/carbon-uuf/issues/160
 [3] https://github.com/wso2/carbon-uuf/issues/166

 @Ayesha: As I understood all these are done for server side JS, I'm

Re: [Dev] How can we add multi language support in javascript files

2017-04-24 Thread Prasanna Dangalla
Hi All,

Kind reminder on this. What should we follow to do internationalization in
javascript code ?

@UUF Team: Shall we come to a final decision regarding this.

Thanks

*Prasanna Dangalla*
Senior Software Engineer, WSO2, Inc.; http://wso2.com/
lean.enterprise.middleware


*cell: +94 718 11 27 51*
*twitter: @prasa77*

On Sun, Mar 26, 2017 at 9:50 AM, Ruwan Abeykoon  wrote:

> Hi All,
> Interesting article about similar requirement[1]
>
> [1] http://nerds.airbnb.com/slides-and-video-from-spike-brehms-tech-talk/
>
> Cheers,
> Ruwan
>
> On Fri, Mar 24, 2017 at 10:55 PM, Prasanna Dangalla 
> wrote:
>
>>
>>
>> On Fri, Mar 24, 2017 at 6:34 PM Manuranga Perera  wrote:
>>
>>> We need to bring whole i18n (combined all lang files) to the UI and
>>> cache it.
>>>
>>
>> Bringing the whole thing will be an expensive operation in the fist time
>> before caching them, IMO we should load page wise and then cache them. WDYT
>> ?
>>
>>>
>>>
>>> On Fri, Mar 24, 2017 at 8:40 AM, Nuwandi Wickramasinghe <
>>> nuwan...@wso2.com> wrote:
>>>
>>>
>>>
>>> On Fri, Mar 24, 2017 at 1:49 PM, Nuwan Dias  wrote:
>>>
>>>
>>>
>>> On Fri, Mar 24, 2017 at 1:23 PM, Ruwan Abeykoon  wrote:
>>>
>>> Hi All,
>>> What if,
>>> i18n is handled on the server side only, and encode the relevant
>>> localized strings into HTML by the server-side (js or hbs).
>>> Client side libraries only read the string values already in the client
>>> locale within HTML DOM itself and just render the data. No client-side i18n.
>>>
>>> I have a situation where a part of the DOM is created in client side JS.
>>> In that case this wouldn't work.
>>>
>>>
>>> What is would be the limitations?
>>>
>>>
>>> Limitations would be for SPAs where the rendering is done at the client
>>> side. Which would basically mean that SPAs can't have localization.
>>>
>>>
>>> Cheers,
>>> Ruwan
>>>
>>> On Fri, Mar 24, 2017 at 11:54 AM, Nipuna Chandradasa 
>>> wrote:
>>>
>>> API of somekind(Rest or a http service endpoint), That we have to think
>>> about,  that exposes a functionality to retrieve i18n as a json object to
>>> layout level or any other global level of the application. So on client
>>> side we can use the i18n language details anywhere.
>>> We can get the language data from the browser.. that's how we do it
>>> anyway i think. We get the i18n based on the what language browser has
>>> configured to use.
>>>
>>> Thank you,
>>>
>>> On Fri, Mar 24, 2017 at 10:14 AM, Prasanna Dangalla 
>>> wrote:
>>>
>>> On Fri, Mar 24, 2017 at 12:53 AM, Nipuna Chandradasa 
>>> wrote:
>>>
>>> I don't think there is a feasible solution rather than loading i18n
>>> config file as a json object to the client side in the beginning of the
>>> app... i think from uuf side we can provide a api for that... WDYT?
>>>
>>> API in the sense, what kind of an API ? Does this loads all the data
>>> into front end or are you thinking about a filtering mechanism for the
>>> language data by page before you send them to front end ?
>>>
>>>
>>> On Thu, Mar 23, 2017 at 5:29 PM, SajithAR Ariyarathna >> > wrote:
>>>
>>> Currently UUF doesn't support i18n in client-side.
>>>
>>> @UUF Team,
>>> We need to come up with a solution for client-side i18n. Shall we start
>>> a discussion on this?
>>>
>>> Thanks.
>>>
>>>
>>> On Thu, Mar 23, 2017 at 4:36 PM, Prasanna Dangalla 
>>> wrote:
>>>
>>> Hi Sajith,
>>>
>>> This is for Client-side JS
>>>
>>> *Prasanna Dangalla*
>>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>>> lean.enterprise.middleware
>>>
>>>
>>> *cell: +94 718 11 27 51*
>>> *twitter: @prasa77*
>>>
>>> On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna >> > wrote:
>>>
>>> Hi Prasanna,
>>>
>>> Is there a mechanism defined to use something like i18n in javascript ?
>>>
>>> Server-side JS or Client-side JS?
>>>
>>> On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka 
>>> wrote:
>>>
>>> Hi Prasanna,
>>>
>>> Similar discussion was started sometime back in [1].
>>> Issues in [2], [3] have some suggestions.
>>>
>>> [1] [Dev][UUF][IS-6] Enable i18n support in javascript
>>> [2] https://github.com/wso2/carbon-uuf/issues/160
>>> [3] https://github.com/wso2/carbon-uuf/issues/166
>>>
>>> @Ayesha: As I understood all these are done for server side JS, I'm
>>> wondering about client side JS.
>>>
>>>
>>>
>>> On Thu, Mar 23, 2017 at 10:46 AM, Pubudu Gunatilaka 
>>> wrote:
>>>
>>> Adding Manu and Sajith.
>>>
>>> On Thu, Mar 23, 2017 at 10:44 AM, Prasanna Dangalla 
>>> wrote:
>>>
>>> Hi Nisala,
>>>
>>> I was wondering how to include this in javascript files, not in hbs
>>> files. Is there a way to include in javascrip fiels ?
>>>
>>> Thanks
>>>
>>> *Prasanna Dangalla*
>>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>>> lean.enterprise.middleware
>>>
>>>
>>> 

Re: [Dev] How can we add multi language support in javascript files

2017-03-25 Thread Ruwan Abeykoon
Hi All,
Interesting article about similar requirement[1]

[1] http://nerds.airbnb.com/slides-and-video-from-spike-brehms-tech-talk/

Cheers,
Ruwan

On Fri, Mar 24, 2017 at 10:55 PM, Prasanna Dangalla 
wrote:

>
>
> On Fri, Mar 24, 2017 at 6:34 PM Manuranga Perera  wrote:
>
>> We need to bring whole i18n (combined all lang files) to the UI and cache
>> it.
>>
>
> Bringing the whole thing will be an expensive operation in the fist time
> before caching them, IMO we should load page wise and then cache them. WDYT
> ?
>
>>
>>
>> On Fri, Mar 24, 2017 at 8:40 AM, Nuwandi Wickramasinghe <
>> nuwan...@wso2.com> wrote:
>>
>>
>>
>> On Fri, Mar 24, 2017 at 1:49 PM, Nuwan Dias  wrote:
>>
>>
>>
>> On Fri, Mar 24, 2017 at 1:23 PM, Ruwan Abeykoon  wrote:
>>
>> Hi All,
>> What if,
>> i18n is handled on the server side only, and encode the relevant
>> localized strings into HTML by the server-side (js or hbs).
>> Client side libraries only read the string values already in the client
>> locale within HTML DOM itself and just render the data. No client-side i18n.
>>
>> I have a situation where a part of the DOM is created in client side JS.
>> In that case this wouldn't work.
>>
>>
>> What is would be the limitations?
>>
>>
>> Limitations would be for SPAs where the rendering is done at the client
>> side. Which would basically mean that SPAs can't have localization.
>>
>>
>> Cheers,
>> Ruwan
>>
>> On Fri, Mar 24, 2017 at 11:54 AM, Nipuna Chandradasa 
>> wrote:
>>
>> API of somekind(Rest or a http service endpoint), That we have to think
>> about,  that exposes a functionality to retrieve i18n as a json object to
>> layout level or any other global level of the application. So on client
>> side we can use the i18n language details anywhere.
>> We can get the language data from the browser.. that's how we do it
>> anyway i think. We get the i18n based on the what language browser has
>> configured to use.
>>
>> Thank you,
>>
>> On Fri, Mar 24, 2017 at 10:14 AM, Prasanna Dangalla 
>> wrote:
>>
>> On Fri, Mar 24, 2017 at 12:53 AM, Nipuna Chandradasa 
>> wrote:
>>
>> I don't think there is a feasible solution rather than loading i18n
>> config file as a json object to the client side in the beginning of the
>> app... i think from uuf side we can provide a api for that... WDYT?
>>
>> API in the sense, what kind of an API ? Does this loads all the data into
>> front end or are you thinking about a filtering mechanism for the language
>> data by page before you send them to front end ?
>>
>>
>> On Thu, Mar 23, 2017 at 5:29 PM, SajithAR Ariyarathna 
>> wrote:
>>
>> Currently UUF doesn't support i18n in client-side.
>>
>> @UUF Team,
>> We need to come up with a solution for client-side i18n. Shall we start a
>> discussion on this?
>>
>> Thanks.
>>
>>
>> On Thu, Mar 23, 2017 at 4:36 PM, Prasanna Dangalla 
>> wrote:
>>
>> Hi Sajith,
>>
>> This is for Client-side JS
>>
>> *Prasanna Dangalla*
>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>> lean.enterprise.middleware
>>
>>
>> *cell: +94 718 11 27 51*
>> *twitter: @prasa77*
>>
>> On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna 
>> wrote:
>>
>> Hi Prasanna,
>>
>> Is there a mechanism defined to use something like i18n in javascript ?
>>
>> Server-side JS or Client-side JS?
>>
>> On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka 
>> wrote:
>>
>> Hi Prasanna,
>>
>> Similar discussion was started sometime back in [1].
>> Issues in [2], [3] have some suggestions.
>>
>> [1] [Dev][UUF][IS-6] Enable i18n support in javascript
>> [2] https://github.com/wso2/carbon-uuf/issues/160
>> [3] https://github.com/wso2/carbon-uuf/issues/166
>>
>> @Ayesha: As I understood all these are done for server side JS, I'm
>> wondering about client side JS.
>>
>>
>>
>> On Thu, Mar 23, 2017 at 10:46 AM, Pubudu Gunatilaka 
>> wrote:
>>
>> Adding Manu and Sajith.
>>
>> On Thu, Mar 23, 2017 at 10:44 AM, Prasanna Dangalla 
>> wrote:
>>
>> Hi Nisala,
>>
>> I was wondering how to include this in javascript files, not in hbs
>> files. Is there a way to include in javascrip fiels ?
>>
>> Thanks
>>
>> *Prasanna Dangalla*
>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>> lean.enterprise.middleware
>>
>>
>> *cell: +94 718 11 27 51*
>> *twitter: @prasa77*
>>
>> On Thu, Mar 23, 2017 at 10:33 AM, Nisala Nanayakkara 
>> wrote:
>>
>> Hi Prasanna,
>>
>> UUF has the capability of facilitating above mentioned scenario. You can
>> define your language property file under the ‘lang’ directory as follows.
>>
>> |src
>> | |main
>> |   | pages/
>> |   | fragments/
>> |   | layouts/
>> |   | modules/
>> |   | lang/
>> |en_US.properties

Re: [Dev] How can we add multi language support in javascript files

2017-03-24 Thread Ruwan Abeykoon
Hi Nuwan,
In SPA, also I assume we have a limited(and finite) set of localized
strings. I think no need to pass entire i18n file(which may be huge) to
client side so that the localization is done at client side. Further one
can argue that transferring the entire i18n file to the client side possess
a security risk, by exposing too many information about the server.
Also having an Ajax call to server side to get the translations done kills
the performance.

So I think it is better in performance wise to translate all the needed
i18n strings in the respective HTML DOM on the server side.

Cheers,
Ruwan

On Fri, Mar 24, 2017 at 2:10 PM, Nuwandi Wickramasinghe 
wrote:

>
>
> On Fri, Mar 24, 2017 at 1:49 PM, Nuwan Dias  wrote:
>
>>
>>
>> On Fri, Mar 24, 2017 at 1:23 PM, Ruwan Abeykoon  wrote:
>>
>>> Hi All,
>>> What if,
>>> i18n is handled on the server side only, and encode the relevant
>>> localized strings into HTML by the server-side (js or hbs).
>>> Client side libraries only read the string values already in the client
>>> locale within HTML DOM itself and just render the data. No client-side i18n.
>>>
>> I have a situation where a part of the DOM is created in client side JS.
> In that case this wouldn't work.
>
>>
>>> What is would be the limitations?
>>>
>>
>> Limitations would be for SPAs where the rendering is done at the client
>> side. Which would basically mean that SPAs can't have localization.
>>
>>>
>>> Cheers,
>>> Ruwan
>>>
>>> On Fri, Mar 24, 2017 at 11:54 AM, Nipuna Chandradasa 
>>> wrote:
>>>
 API of somekind(Rest or a http service endpoint), That we have to think
 about,  that exposes a functionality to retrieve i18n as a json object to
 layout level or any other global level of the application. So on client
 side we can use the i18n language details anywhere.
 We can get the language data from the browser.. that's how we do it
 anyway i think. We get the i18n based on the what language browser has
 configured to use.

 Thank you,

 On Fri, Mar 24, 2017 at 10:14 AM, Prasanna Dangalla 
 wrote:

> On Fri, Mar 24, 2017 at 12:53 AM, Nipuna Chandradasa  > wrote:
>
>> I don't think there is a feasible solution rather than loading i18n
>> config file as a json object to the client side in the beginning of the
>> app... i think from uuf side we can provide a api for that... WDYT?
>>
> API in the sense, what kind of an API ? Does this loads all the data
> into front end or are you thinking about a filtering mechanism for the
> language data by page before you send them to front end ?
>
>
> On Thu, Mar 23, 2017 at 5:29 PM, SajithAR Ariyarathna <
> sajit...@wso2.com> wrote:
>
>> Currently UUF doesn't support i18n in client-side.
>>
>> @UUF Team,
>> We need to come up with a solution for client-side i18n. Shall we
>> start a discussion on this?
>>
>> Thanks.
>>
>>
>> On Thu, Mar 23, 2017 at 4:36 PM, Prasanna Dangalla > > wrote:
>>
>>> Hi Sajith,
>>>
>>> This is for Client-side JS
>>>
>>> *Prasanna Dangalla*
>>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>>> lean.enterprise.middleware
>>>
>>>
>>> *cell: +94 718 11 27 51*
>>> *twitter: @prasa77*
>>>
>>> On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna <
>>> sajit...@wso2.com> wrote:
>>>
 Hi Prasanna,

 Is there a mechanism defined to use something like i18n in
> javascript ?

 Server-side JS or Client-side JS?

 On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka <
 aye...@wso2.com> wrote:

> Hi Prasanna,
>
> Similar discussion was started sometime back in [1].
> Issues in [2], [3] have some suggestions.
>
> [1] [Dev][UUF][IS-6] Enable i18n support in javascript
> [2] https://github.com/wso2/carbon-uuf/issues/160
> [3] https://github.com/wso2/carbon-uuf/issues/166
>
> @Ayesha: As I understood all these are done for server side JS,
>>> I'm wondering about client side JS.
>>>
>>>

> On Thu, Mar 23, 2017 at 10:46 AM, Pubudu Gunatilaka <
> pubu...@wso2.com> wrote:
>
>> Adding Manu and Sajith.
>>
>> On Thu, Mar 23, 2017 at 10:44 AM, Prasanna Dangalla <
>> prasa...@wso2.com> wrote:
>>
>>> Hi Nisala,
>>>
>>> I was wondering how to include this in javascript files, not in
>>> hbs files. Is there a way to include in javascrip fiels ?
>>>
>>> Thanks
>>>
>>> *Prasanna Dangalla*
>>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>>> lean.enterprise.middleware
>>>

Re: [Dev] How can we add multi language support in javascript files

2017-03-24 Thread Nuwan Dias
On Fri, Mar 24, 2017 at 2:32 PM, Ruwan Abeykoon  wrote:

> Hi Nuwan,
> In SPA, also I assume we have a limited(and finite) set of localized
> strings. I think no need to pass entire i18n file(which may be huge) to
> client side so that the localization is done at client side. Further one
> can argue that transferring the entire i18n file to the client side possess
> a security risk, by exposing too many information about the server.
> Also having an Ajax call to server side to get the translations done kills
> the performance.
>
> So I think it is better in performance wise to translate all the needed
> i18n strings in the respective HTML DOM on the server side.
>

Well, doesn't it break the whole concept of SPA? The API Store and
Publisher on API Manager 3.0.0 is built using an SPA architecture. Hasn't
this been done before by anybody, doing i18 stuff on the client side?

>
> Cheers,
> Ruwan
>
> On Fri, Mar 24, 2017 at 2:10 PM, Nuwandi Wickramasinghe  > wrote:
>
>>
>>
>> On Fri, Mar 24, 2017 at 1:49 PM, Nuwan Dias  wrote:
>>
>>>
>>>
>>> On Fri, Mar 24, 2017 at 1:23 PM, Ruwan Abeykoon  wrote:
>>>
 Hi All,
 What if,
 i18n is handled on the server side only, and encode the relevant
 localized strings into HTML by the server-side (js or hbs).
 Client side libraries only read the string values already in the client
 locale within HTML DOM itself and just render the data. No client-side 
 i18n.

>>> I have a situation where a part of the DOM is created in client side JS.
>> In that case this wouldn't work.
>>
>>>
 What is would be the limitations?

>>>
>>> Limitations would be for SPAs where the rendering is done at the client
>>> side. Which would basically mean that SPAs can't have localization.
>>>

 Cheers,
 Ruwan

 On Fri, Mar 24, 2017 at 11:54 AM, Nipuna Chandradasa 
 wrote:

> API of somekind(Rest or a http service endpoint), That we have to
> think about,  that exposes a functionality to retrieve i18n as a json
> object to layout level or any other global level of the application. So on
> client side we can use the i18n language details anywhere.
> We can get the language data from the browser.. that's how we do it
> anyway i think. We get the i18n based on the what language browser has
> configured to use.
>
> Thank you,
>
> On Fri, Mar 24, 2017 at 10:14 AM, Prasanna Dangalla  > wrote:
>
>> On Fri, Mar 24, 2017 at 12:53 AM, Nipuna Chandradasa <
>> nipu...@wso2.com> wrote:
>>
>>> I don't think there is a feasible solution rather than loading i18n
>>> config file as a json object to the client side in the beginning of the
>>> app... i think from uuf side we can provide a api for that... WDYT?
>>>
>> API in the sense, what kind of an API ? Does this loads all the data
>> into front end or are you thinking about a filtering mechanism for the
>> language data by page before you send them to front end ?
>>
>>
>> On Thu, Mar 23, 2017 at 5:29 PM, SajithAR Ariyarathna <
>> sajit...@wso2.com> wrote:
>>
>>> Currently UUF doesn't support i18n in client-side.
>>>
>>> @UUF Team,
>>> We need to come up with a solution for client-side i18n. Shall we
>>> start a discussion on this?
>>>
>>> Thanks.
>>>
>>>
>>> On Thu, Mar 23, 2017 at 4:36 PM, Prasanna Dangalla <
>>> prasa...@wso2.com> wrote:
>>>
 Hi Sajith,

 This is for Client-side JS

 *Prasanna Dangalla*
 Senior Software Engineer, WSO2, Inc.; http://wso2.com/
 lean.enterprise.middleware


 *cell: +94 718 11 27 51*
 *twitter: @prasa77*

 On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna <
 sajit...@wso2.com> wrote:

> Hi Prasanna,
>
> Is there a mechanism defined to use something like i18n in
>> javascript ?
>
> Server-side JS or Client-side JS?
>
> On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka <
> aye...@wso2.com> wrote:
>
>> Hi Prasanna,
>>
>> Similar discussion was started sometime back in [1].
>> Issues in [2], [3] have some suggestions.
>>
>> [1] [Dev][UUF][IS-6] Enable i18n support in javascript
>> [2] https://github.com/wso2/carbon-uuf/issues/160
>> [3] https://github.com/wso2/carbon-uuf/issues/166
>>
>> @Ayesha: As I understood all these are done for server side JS,
 I'm wondering about client side JS.


>
>> On Thu, Mar 23, 2017 at 10:46 AM, Pubudu Gunatilaka <
>> pubu...@wso2.com> wrote:
>>
>>> Adding Manu and Sajith.
>>>
>>> On Thu, Mar 23, 2017 at 10:44 AM, 

Re: [Dev] How can we add multi language support in javascript files

2017-03-24 Thread Prasanna Dangalla
On Fri, Mar 24, 2017 at 6:34 PM Manuranga Perera  wrote:

> We need to bring whole i18n (combined all lang files) to the UI and cache
> it.
>

Bringing the whole thing will be an expensive operation in the fist time
before caching them, IMO we should load page wise and then cache them. WDYT
?

>
>
> On Fri, Mar 24, 2017 at 8:40 AM, Nuwandi Wickramasinghe  > wrote:
>
>
>
> On Fri, Mar 24, 2017 at 1:49 PM, Nuwan Dias  wrote:
>
>
>
> On Fri, Mar 24, 2017 at 1:23 PM, Ruwan Abeykoon  wrote:
>
> Hi All,
> What if,
> i18n is handled on the server side only, and encode the relevant localized
> strings into HTML by the server-side (js or hbs).
> Client side libraries only read the string values already in the client
> locale within HTML DOM itself and just render the data. No client-side i18n.
>
> I have a situation where a part of the DOM is created in client side JS.
> In that case this wouldn't work.
>
>
> What is would be the limitations?
>
>
> Limitations would be for SPAs where the rendering is done at the client
> side. Which would basically mean that SPAs can't have localization.
>
>
> Cheers,
> Ruwan
>
> On Fri, Mar 24, 2017 at 11:54 AM, Nipuna Chandradasa 
> wrote:
>
> API of somekind(Rest or a http service endpoint), That we have to think
> about,  that exposes a functionality to retrieve i18n as a json object to
> layout level or any other global level of the application. So on client
> side we can use the i18n language details anywhere.
> We can get the language data from the browser.. that's how we do it anyway
> i think. We get the i18n based on the what language browser has configured
> to use.
>
> Thank you,
>
> On Fri, Mar 24, 2017 at 10:14 AM, Prasanna Dangalla 
> wrote:
>
> On Fri, Mar 24, 2017 at 12:53 AM, Nipuna Chandradasa 
> wrote:
>
> I don't think there is a feasible solution rather than loading i18n config
> file as a json object to the client side in the beginning of the app... i
> think from uuf side we can provide a api for that... WDYT?
>
> API in the sense, what kind of an API ? Does this loads all the data into
> front end or are you thinking about a filtering mechanism for the language
> data by page before you send them to front end ?
>
>
> On Thu, Mar 23, 2017 at 5:29 PM, SajithAR Ariyarathna 
> wrote:
>
> Currently UUF doesn't support i18n in client-side.
>
> @UUF Team,
> We need to come up with a solution for client-side i18n. Shall we start a
> discussion on this?
>
> Thanks.
>
>
> On Thu, Mar 23, 2017 at 4:36 PM, Prasanna Dangalla 
> wrote:
>
> Hi Sajith,
>
> This is for Client-side JS
>
> *Prasanna Dangalla*
> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
> lean.enterprise.middleware
>
>
> *cell: +94 718 11 27 51*
> *twitter: @prasa77*
>
> On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna 
> wrote:
>
> Hi Prasanna,
>
> Is there a mechanism defined to use something like i18n in javascript ?
>
> Server-side JS or Client-side JS?
>
> On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka 
> wrote:
>
> Hi Prasanna,
>
> Similar discussion was started sometime back in [1].
> Issues in [2], [3] have some suggestions.
>
> [1] [Dev][UUF][IS-6] Enable i18n support in javascript
> [2] https://github.com/wso2/carbon-uuf/issues/160
> [3] https://github.com/wso2/carbon-uuf/issues/166
>
> @Ayesha: As I understood all these are done for server side JS, I'm
> wondering about client side JS.
>
>
>
> On Thu, Mar 23, 2017 at 10:46 AM, Pubudu Gunatilaka 
> wrote:
>
> Adding Manu and Sajith.
>
> On Thu, Mar 23, 2017 at 10:44 AM, Prasanna Dangalla 
> wrote:
>
> Hi Nisala,
>
> I was wondering how to include this in javascript files, not in hbs files.
> Is there a way to include in javascrip fiels ?
>
> Thanks
>
> *Prasanna Dangalla*
> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
> lean.enterprise.middleware
>
>
> *cell: +94 718 11 27 51*
> *twitter: @prasa77*
>
> On Thu, Mar 23, 2017 at 10:33 AM, Nisala Nanayakkara 
> wrote:
>
> Hi Prasanna,
>
> UUF has the capability of facilitating above mentioned scenario. You can
> define your language property file under the ‘lang’ directory as follows.
>
> |src
> | |main
> |   | pages/
> |   | fragments/
> |   | layouts/
> |   | modules/
> |   | lang/
> |en_US.properties
> |   | public/
>
> After that you can use following code segment to achieve your requirement
> in your hbs file.
>
> {{i18n "my.sample.key"}}
>
> Please go through sample app available here[1] if you need more
> clarification. Moreover you can find actual usage above code segment
> here[2] and corresponding language file here[3].
>
> [1] -
> 

Re: [Dev] How can we add multi language support in javascript files

2017-03-24 Thread Manuranga Perera
>
> Bringing the whole thing will be an expensive operation in the fist time
> before caching them, IMO we should load page wise and then cache them. WDYT
> ?
>
Bringing it one time is always faster, and much simpler to debug ect.

http://stackoverflow.com/questions/9855545/http-requests-vs-file-size

On Fri, Mar 24, 2017 at 5:14 PM, Kasun Thennakoon  wrote:

> Hi all,
>
>
> On Fri, Mar 24, 2017 at 4:13 PM, Chanaka Jayasena 
> wrote:
>
>> I think we can do the same we did with jaggery base APIM UI using i18next
>> library. http://i18next.com/
>>
>
> +1 to use i18next[1],
>  We could use the *i18next-xhr-backend* with the support from UUF to
> provide i18n msf4j service to get the language mapping data.It also support
> cache via local storage. So IMHO embeding similar functionality into UUF
> client would be like re inventing the wheel.If we going to use i18next
> library, all we need is simple locale service, which other wise we need to
> have service + client library too.
>
> [1]: http://i18next.com/
> [2]: http://i18next.com/docs/ecosystem/#caches
> --
> *Kasun Thennakoon*
> Software Engineer
> WSO2, Inc.
> Mobile:+94 711661919
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
With regards,
*Manu*ranga Perera.

phone : 071 7 70 20 50
mail : m...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How can we add multi language support in javascript files

2017-03-24 Thread Kasun Thennakoon
Hi all,


On Fri, Mar 24, 2017 at 4:13 PM, Chanaka Jayasena  wrote:

> I think we can do the same we did with jaggery base APIM UI using i18next
> library. http://i18next.com/
>

+1 to use i18next[1],
 We could use the *i18next-xhr-backend* with the support from UUF to
provide i18n msf4j service to get the language mapping data.It also support
cache via local storage. So IMHO embeding similar functionality into UUF
client would be like re inventing the wheel.If we going to use i18next
library, all we need is simple locale service, which other wise we need to
have service + client library too.

[1]: http://i18next.com/
[2]: http://i18next.com/docs/ecosystem/#caches
-- 
*Kasun Thennakoon*
Software Engineer
WSO2, Inc.
Mobile:+94 711661919
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How can we add multi language support in javascript files

2017-03-24 Thread Manuranga Perera
We need to bring whole i18n (combined all lang files) to the UI and cache
it.

On Fri, Mar 24, 2017 at 8:40 AM, Nuwandi Wickramasinghe 
wrote:

>
>
> On Fri, Mar 24, 2017 at 1:49 PM, Nuwan Dias  wrote:
>
>>
>>
>> On Fri, Mar 24, 2017 at 1:23 PM, Ruwan Abeykoon  wrote:
>>
>>> Hi All,
>>> What if,
>>> i18n is handled on the server side only, and encode the relevant
>>> localized strings into HTML by the server-side (js or hbs).
>>> Client side libraries only read the string values already in the client
>>> locale within HTML DOM itself and just render the data. No client-side i18n.
>>>
>> I have a situation where a part of the DOM is created in client side JS.
> In that case this wouldn't work.
>
>>
>>> What is would be the limitations?
>>>
>>
>> Limitations would be for SPAs where the rendering is done at the client
>> side. Which would basically mean that SPAs can't have localization.
>>
>>>
>>> Cheers,
>>> Ruwan
>>>
>>> On Fri, Mar 24, 2017 at 11:54 AM, Nipuna Chandradasa 
>>> wrote:
>>>
 API of somekind(Rest or a http service endpoint), That we have to think
 about,  that exposes a functionality to retrieve i18n as a json object to
 layout level or any other global level of the application. So on client
 side we can use the i18n language details anywhere.
 We can get the language data from the browser.. that's how we do it
 anyway i think. We get the i18n based on the what language browser has
 configured to use.

 Thank you,

 On Fri, Mar 24, 2017 at 10:14 AM, Prasanna Dangalla 
 wrote:

> On Fri, Mar 24, 2017 at 12:53 AM, Nipuna Chandradasa  > wrote:
>
>> I don't think there is a feasible solution rather than loading i18n
>> config file as a json object to the client side in the beginning of the
>> app... i think from uuf side we can provide a api for that... WDYT?
>>
> API in the sense, what kind of an API ? Does this loads all the data
> into front end or are you thinking about a filtering mechanism for the
> language data by page before you send them to front end ?
>
>
> On Thu, Mar 23, 2017 at 5:29 PM, SajithAR Ariyarathna <
> sajit...@wso2.com> wrote:
>
>> Currently UUF doesn't support i18n in client-side.
>>
>> @UUF Team,
>> We need to come up with a solution for client-side i18n. Shall we
>> start a discussion on this?
>>
>> Thanks.
>>
>>
>> On Thu, Mar 23, 2017 at 4:36 PM, Prasanna Dangalla > > wrote:
>>
>>> Hi Sajith,
>>>
>>> This is for Client-side JS
>>>
>>> *Prasanna Dangalla*
>>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>>> lean.enterprise.middleware
>>>
>>>
>>> *cell: +94 718 11 27 51*
>>> *twitter: @prasa77*
>>>
>>> On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna <
>>> sajit...@wso2.com> wrote:
>>>
 Hi Prasanna,

 Is there a mechanism defined to use something like i18n in
> javascript ?

 Server-side JS or Client-side JS?

 On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka <
 aye...@wso2.com> wrote:

> Hi Prasanna,
>
> Similar discussion was started sometime back in [1].
> Issues in [2], [3] have some suggestions.
>
> [1] [Dev][UUF][IS-6] Enable i18n support in javascript
> [2] https://github.com/wso2/carbon-uuf/issues/160
> [3] https://github.com/wso2/carbon-uuf/issues/166
>
> @Ayesha: As I understood all these are done for server side JS,
>>> I'm wondering about client side JS.
>>>
>>>

> On Thu, Mar 23, 2017 at 10:46 AM, Pubudu Gunatilaka <
> pubu...@wso2.com> wrote:
>
>> Adding Manu and Sajith.
>>
>> On Thu, Mar 23, 2017 at 10:44 AM, Prasanna Dangalla <
>> prasa...@wso2.com> wrote:
>>
>>> Hi Nisala,
>>>
>>> I was wondering how to include this in javascript files, not in
>>> hbs files. Is there a way to include in javascrip fiels ?
>>>
>>> Thanks
>>>
>>> *Prasanna Dangalla*
>>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>>> lean.enterprise.middleware
>>>
>>>
>>> *cell: +94 718 11 27 51*
>>> *twitter: @prasa77*
>>>
>>> On Thu, Mar 23, 2017 at 10:33 AM, Nisala Nanayakkara <
>>> nis...@wso2.com> wrote:
>>>
 Hi Prasanna,

 UUF has the capability of facilitating above mentioned
 scenario. You can define your language property file under the 
 ‘lang’
 directory as follows.

 |src
 | |main
 | 

Re: [Dev] How can we add multi language support in javascript files

2017-03-24 Thread Manuranga Perera
Ya that is needed but, that is too much work for the app dev, for the
template usecase. So we need a convenient way.
Ideally if you have {{i18n "key"}} hbs, it should automatically work same
as in backbend UUF. This means we have to write a js helper, and inside
that we can use the above API you propose.

As a implementation detail, we should use a simple key-value json API, just
like the lib chanaka mentions, so we have the option to switch if needed.

On Fri, Mar 24, 2017 at 10:26 AM, SajithAR Ariyarathna 
wrote:

> There are some usecase where web app developers need client-side i18n.
>
> IMO, we can give this capability through UUF Client library.
>
> UUFClient.i18n("message.key"); // value of the Accept-Language header will be 
> used to compute locale
> UUFClient.i18n("message.key", parameters[]);
> UUFClient.i18n("message.key", parameters[], "en-AU"); // use the specified 
> locale
>
>
> UUFClient will do whatever needs to get the translated string, so the
> webapp developer doesn't need to worry about calling some REST API or
> sending i18n language files to client-side.
>
>
> On Fri, Mar 24, 2017 at 2:10 PM, Nuwandi Wickramasinghe  > wrote:
>
>>
>>
>> On Fri, Mar 24, 2017 at 1:49 PM, Nuwan Dias  wrote:
>>
>>>
>>>
>>> On Fri, Mar 24, 2017 at 1:23 PM, Ruwan Abeykoon  wrote:
>>>
 Hi All,
 What if,
 i18n is handled on the server side only, and encode the relevant
 localized strings into HTML by the server-side (js or hbs).
 Client side libraries only read the string values already in the client
 locale within HTML DOM itself and just render the data. No client-side 
 i18n.

>>> I have a situation where a part of the DOM is created in client side JS.
>> In that case this wouldn't work.
>>
>>>
 What is would be the limitations?

>>>
>>> Limitations would be for SPAs where the rendering is done at the client
>>> side. Which would basically mean that SPAs can't have localization.
>>>

 Cheers,
 Ruwan

 On Fri, Mar 24, 2017 at 11:54 AM, Nipuna Chandradasa 
 wrote:

> API of somekind(Rest or a http service endpoint), That we have to
> think about,  that exposes a functionality to retrieve i18n as a json
> object to layout level or any other global level of the application. So on
> client side we can use the i18n language details anywhere.
> We can get the language data from the browser.. that's how we do it
> anyway i think. We get the i18n based on the what language browser has
> configured to use.
>
> Thank you,
>
> On Fri, Mar 24, 2017 at 10:14 AM, Prasanna Dangalla  > wrote:
>
>> On Fri, Mar 24, 2017 at 12:53 AM, Nipuna Chandradasa <
>> nipu...@wso2.com> wrote:
>>
>>> I don't think there is a feasible solution rather than loading i18n
>>> config file as a json object to the client side in the beginning of the
>>> app... i think from uuf side we can provide a api for that... WDYT?
>>>
>> API in the sense, what kind of an API ? Does this loads all the data
>> into front end or are you thinking about a filtering mechanism for the
>> language data by page before you send them to front end ?
>>
>>
>> On Thu, Mar 23, 2017 at 5:29 PM, SajithAR Ariyarathna <
>> sajit...@wso2.com> wrote:
>>
>>> Currently UUF doesn't support i18n in client-side.
>>>
>>> @UUF Team,
>>> We need to come up with a solution for client-side i18n. Shall we
>>> start a discussion on this?
>>>
>>> Thanks.
>>>
>>>
>>> On Thu, Mar 23, 2017 at 4:36 PM, Prasanna Dangalla <
>>> prasa...@wso2.com> wrote:
>>>
 Hi Sajith,

 This is for Client-side JS

 *Prasanna Dangalla*
 Senior Software Engineer, WSO2, Inc.; http://wso2.com/
 lean.enterprise.middleware


 *cell: +94 718 11 27 51*
 *twitter: @prasa77*

 On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna <
 sajit...@wso2.com> wrote:

> Hi Prasanna,
>
> Is there a mechanism defined to use something like i18n in
>> javascript ?
>
> Server-side JS or Client-side JS?
>
> On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka <
> aye...@wso2.com> wrote:
>
>> Hi Prasanna,
>>
>> Similar discussion was started sometime back in [1].
>> Issues in [2], [3] have some suggestions.
>>
>> [1] [Dev][UUF][IS-6] Enable i18n support in javascript
>> [2] https://github.com/wso2/carbon-uuf/issues/160
>> [3] https://github.com/wso2/carbon-uuf/issues/166
>>
>> @Ayesha: As I understood all these are done for server side JS,
 I'm wondering about client side JS.


>
>> On 

Re: [Dev] How can we add multi language support in javascript files

2017-03-24 Thread SajithAR Ariyarathna
There are some usecase where web app developers need client-side i18n.

IMO, we can give this capability through UUF Client library.

UUFClient.i18n("message.key"); // value of the Accept-Language header
will be used to compute locale
UUFClient.i18n("message.key", parameters[]);
UUFClient.i18n("message.key", parameters[], "en-AU"); // use the
specified locale


UUFClient will do whatever needs to get the translated string, so the
webapp developer doesn't need to worry about calling some REST API or
sending i18n language files to client-side.


On Fri, Mar 24, 2017 at 2:10 PM, Nuwandi Wickramasinghe 
wrote:

>
>
> On Fri, Mar 24, 2017 at 1:49 PM, Nuwan Dias  wrote:
>
>>
>>
>> On Fri, Mar 24, 2017 at 1:23 PM, Ruwan Abeykoon  wrote:
>>
>>> Hi All,
>>> What if,
>>> i18n is handled on the server side only, and encode the relevant
>>> localized strings into HTML by the server-side (js or hbs).
>>> Client side libraries only read the string values already in the client
>>> locale within HTML DOM itself and just render the data. No client-side i18n.
>>>
>> I have a situation where a part of the DOM is created in client side JS.
> In that case this wouldn't work.
>
>>
>>> What is would be the limitations?
>>>
>>
>> Limitations would be for SPAs where the rendering is done at the client
>> side. Which would basically mean that SPAs can't have localization.
>>
>>>
>>> Cheers,
>>> Ruwan
>>>
>>> On Fri, Mar 24, 2017 at 11:54 AM, Nipuna Chandradasa 
>>> wrote:
>>>
 API of somekind(Rest or a http service endpoint), That we have to think
 about,  that exposes a functionality to retrieve i18n as a json object to
 layout level or any other global level of the application. So on client
 side we can use the i18n language details anywhere.
 We can get the language data from the browser.. that's how we do it
 anyway i think. We get the i18n based on the what language browser has
 configured to use.

 Thank you,

 On Fri, Mar 24, 2017 at 10:14 AM, Prasanna Dangalla 
 wrote:

> On Fri, Mar 24, 2017 at 12:53 AM, Nipuna Chandradasa  > wrote:
>
>> I don't think there is a feasible solution rather than loading i18n
>> config file as a json object to the client side in the beginning of the
>> app... i think from uuf side we can provide a api for that... WDYT?
>>
> API in the sense, what kind of an API ? Does this loads all the data
> into front end or are you thinking about a filtering mechanism for the
> language data by page before you send them to front end ?
>
>
> On Thu, Mar 23, 2017 at 5:29 PM, SajithAR Ariyarathna <
> sajit...@wso2.com> wrote:
>
>> Currently UUF doesn't support i18n in client-side.
>>
>> @UUF Team,
>> We need to come up with a solution for client-side i18n. Shall we
>> start a discussion on this?
>>
>> Thanks.
>>
>>
>> On Thu, Mar 23, 2017 at 4:36 PM, Prasanna Dangalla > > wrote:
>>
>>> Hi Sajith,
>>>
>>> This is for Client-side JS
>>>
>>> *Prasanna Dangalla*
>>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>>> lean.enterprise.middleware
>>>
>>>
>>> *cell: +94 718 11 27 51*
>>> *twitter: @prasa77*
>>>
>>> On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna <
>>> sajit...@wso2.com> wrote:
>>>
 Hi Prasanna,

 Is there a mechanism defined to use something like i18n in
> javascript ?

 Server-side JS or Client-side JS?

 On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka <
 aye...@wso2.com> wrote:

> Hi Prasanna,
>
> Similar discussion was started sometime back in [1].
> Issues in [2], [3] have some suggestions.
>
> [1] [Dev][UUF][IS-6] Enable i18n support in javascript
> [2] https://github.com/wso2/carbon-uuf/issues/160
> [3] https://github.com/wso2/carbon-uuf/issues/166
>
> @Ayesha: As I understood all these are done for server side JS,
>>> I'm wondering about client side JS.
>>>
>>>

> On Thu, Mar 23, 2017 at 10:46 AM, Pubudu Gunatilaka <
> pubu...@wso2.com> wrote:
>
>> Adding Manu and Sajith.
>>
>> On Thu, Mar 23, 2017 at 10:44 AM, Prasanna Dangalla <
>> prasa...@wso2.com> wrote:
>>
>>> Hi Nisala,
>>>
>>> I was wondering how to include this in javascript files, not in
>>> hbs files. Is there a way to include in javascrip fiels ?
>>>
>>> Thanks
>>>
>>> *Prasanna Dangalla*
>>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>>> lean.enterprise.middleware
>>>
>>>
>>> *cell: +94 718 11 27 51*
>>> 

Re: [Dev] How can we add multi language support in javascript files

2017-03-24 Thread Chanaka Jayasena
I think we can do the same we did with jaggery base APIM UI using i18next
library. http://i18next.com/

thanks,
Chanaka

On Fri, Mar 24, 2017 at 3:36 AM, Nuwan Dias  wrote:

>
>
> On Fri, Mar 24, 2017 at 2:32 PM, Ruwan Abeykoon  wrote:
>
>> Hi Nuwan,
>> In SPA, also I assume we have a limited(and finite) set of localized
>> strings. I think no need to pass entire i18n file(which may be huge) to
>> client side so that the localization is done at client side. Further one
>> can argue that transferring the entire i18n file to the client side possess
>> a security risk, by exposing too many information about the server.
>> Also having an Ajax call to server side to get the translations done
>> kills the performance.
>>
>> So I think it is better in performance wise to translate all the needed
>> i18n strings in the respective HTML DOM on the server side.
>>
>
> Well, doesn't it break the whole concept of SPA? The API Store and
> Publisher on API Manager 3.0.0 is built using an SPA architecture. Hasn't
> this been done before by anybody, doing i18 stuff on the client side?
>
>>
>> Cheers,
>> Ruwan
>>
>> On Fri, Mar 24, 2017 at 2:10 PM, Nuwandi Wickramasinghe <
>> nuwan...@wso2.com> wrote:
>>
>>>
>>>
>>> On Fri, Mar 24, 2017 at 1:49 PM, Nuwan Dias  wrote:
>>>


 On Fri, Mar 24, 2017 at 1:23 PM, Ruwan Abeykoon 
 wrote:

> Hi All,
> What if,
> i18n is handled on the server side only, and encode the relevant
> localized strings into HTML by the server-side (js or hbs).
> Client side libraries only read the string values already in the
> client locale within HTML DOM itself and just render the data. No
> client-side i18n.
>
 I have a situation where a part of the DOM is created in client side
>>> JS. In that case this wouldn't work.
>>>

> What is would be the limitations?
>

 Limitations would be for SPAs where the rendering is done at the client
 side. Which would basically mean that SPAs can't have localization.

>
> Cheers,
> Ruwan
>
> On Fri, Mar 24, 2017 at 11:54 AM, Nipuna Chandradasa  > wrote:
>
>> API of somekind(Rest or a http service endpoint), That we have to
>> think about,  that exposes a functionality to retrieve i18n as a json
>> object to layout level or any other global level of the application. So 
>> on
>> client side we can use the i18n language details anywhere.
>> We can get the language data from the browser.. that's how we do it
>> anyway i think. We get the i18n based on the what language browser has
>> configured to use.
>>
>> Thank you,
>>
>> On Fri, Mar 24, 2017 at 10:14 AM, Prasanna Dangalla <
>> prasa...@wso2.com> wrote:
>>
>>> On Fri, Mar 24, 2017 at 12:53 AM, Nipuna Chandradasa <
>>> nipu...@wso2.com> wrote:
>>>
 I don't think there is a feasible solution rather than loading i18n
 config file as a json object to the client side in the beginning of the
 app... i think from uuf side we can provide a api for that... WDYT?

>>> API in the sense, what kind of an API ? Does this loads all the data
>>> into front end or are you thinking about a filtering mechanism for the
>>> language data by page before you send them to front end ?
>>>
>>>
>>> On Thu, Mar 23, 2017 at 5:29 PM, SajithAR Ariyarathna <
>>> sajit...@wso2.com> wrote:
>>>
 Currently UUF doesn't support i18n in client-side.

 @UUF Team,
 We need to come up with a solution for client-side i18n. Shall we
 start a discussion on this?

 Thanks.


 On Thu, Mar 23, 2017 at 4:36 PM, Prasanna Dangalla <
 prasa...@wso2.com> wrote:

> Hi Sajith,
>
> This is for Client-side JS
>
> *Prasanna Dangalla*
> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
> lean.enterprise.middleware
>
>
> *cell: +94 718 11 27 51*
> *twitter: @prasa77*
>
> On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna <
> sajit...@wso2.com> wrote:
>
>> Hi Prasanna,
>>
>> Is there a mechanism defined to use something like i18n in
>>> javascript ?
>>
>> Server-side JS or Client-side JS?
>>
>> On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka <
>> aye...@wso2.com> wrote:
>>
>>> Hi Prasanna,
>>>
>>> Similar discussion was started sometime back in [1].
>>> Issues in [2], [3] have some suggestions.
>>>
>>> [1] [Dev][UUF][IS-6] Enable i18n support in javascript
>>> [2] https://github.com/wso2/carbon-uuf/issues/160
>>> [3] https://github.com/wso2/carbon-uuf/issues/166
>>>
>>> 

Re: [Dev] How can we add multi language support in javascript files

2017-03-24 Thread Nuwandi Wickramasinghe
On Fri, Mar 24, 2017 at 1:49 PM, Nuwan Dias  wrote:

>
>
> On Fri, Mar 24, 2017 at 1:23 PM, Ruwan Abeykoon  wrote:
>
>> Hi All,
>> What if,
>> i18n is handled on the server side only, and encode the relevant
>> localized strings into HTML by the server-side (js or hbs).
>> Client side libraries only read the string values already in the client
>> locale within HTML DOM itself and just render the data. No client-side i18n.
>>
> I have a situation where a part of the DOM is created in client side JS.
In that case this wouldn't work.

>
>> What is would be the limitations?
>>
>
> Limitations would be for SPAs where the rendering is done at the client
> side. Which would basically mean that SPAs can't have localization.
>
>>
>> Cheers,
>> Ruwan
>>
>> On Fri, Mar 24, 2017 at 11:54 AM, Nipuna Chandradasa 
>> wrote:
>>
>>> API of somekind(Rest or a http service endpoint), That we have to think
>>> about,  that exposes a functionality to retrieve i18n as a json object to
>>> layout level or any other global level of the application. So on client
>>> side we can use the i18n language details anywhere.
>>> We can get the language data from the browser.. that's how we do it
>>> anyway i think. We get the i18n based on the what language browser has
>>> configured to use.
>>>
>>> Thank you,
>>>
>>> On Fri, Mar 24, 2017 at 10:14 AM, Prasanna Dangalla 
>>> wrote:
>>>
 On Fri, Mar 24, 2017 at 12:53 AM, Nipuna Chandradasa 
 wrote:

> I don't think there is a feasible solution rather than loading i18n
> config file as a json object to the client side in the beginning of the
> app... i think from uuf side we can provide a api for that... WDYT?
>
 API in the sense, what kind of an API ? Does this loads all the data
 into front end or are you thinking about a filtering mechanism for the
 language data by page before you send them to front end ?


 On Thu, Mar 23, 2017 at 5:29 PM, SajithAR Ariyarathna <
 sajit...@wso2.com> wrote:

> Currently UUF doesn't support i18n in client-side.
>
> @UUF Team,
> We need to come up with a solution for client-side i18n. Shall we
> start a discussion on this?
>
> Thanks.
>
>
> On Thu, Mar 23, 2017 at 4:36 PM, Prasanna Dangalla 
> wrote:
>
>> Hi Sajith,
>>
>> This is for Client-side JS
>>
>> *Prasanna Dangalla*
>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>> lean.enterprise.middleware
>>
>>
>> *cell: +94 718 11 27 51*
>> *twitter: @prasa77*
>>
>> On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna <
>> sajit...@wso2.com> wrote:
>>
>>> Hi Prasanna,
>>>
>>> Is there a mechanism defined to use something like i18n in
 javascript ?
>>>
>>> Server-side JS or Client-side JS?
>>>
>>> On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka <
>>> aye...@wso2.com> wrote:
>>>
 Hi Prasanna,

 Similar discussion was started sometime back in [1].
 Issues in [2], [3] have some suggestions.

 [1] [Dev][UUF][IS-6] Enable i18n support in javascript
 [2] https://github.com/wso2/carbon-uuf/issues/160
 [3] https://github.com/wso2/carbon-uuf/issues/166

 @Ayesha: As I understood all these are done for server side JS, I'm
>> wondering about client side JS.
>>
>>
>>>
 On Thu, Mar 23, 2017 at 10:46 AM, Pubudu Gunatilaka <
 pubu...@wso2.com> wrote:

> Adding Manu and Sajith.
>
> On Thu, Mar 23, 2017 at 10:44 AM, Prasanna Dangalla <
> prasa...@wso2.com> wrote:
>
>> Hi Nisala,
>>
>> I was wondering how to include this in javascript files, not in
>> hbs files. Is there a way to include in javascrip fiels ?
>>
>> Thanks
>>
>> *Prasanna Dangalla*
>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>> lean.enterprise.middleware
>>
>>
>> *cell: +94 718 11 27 51*
>> *twitter: @prasa77*
>>
>> On Thu, Mar 23, 2017 at 10:33 AM, Nisala Nanayakkara <
>> nis...@wso2.com> wrote:
>>
>>> Hi Prasanna,
>>>
>>> UUF has the capability of facilitating above mentioned scenario.
>>> You can define your language property file under the ‘lang’ 
>>> directory as
>>> follows.
>>>
>>> |src
>>> | |main
>>> |   | pages/
>>> |   | fragments/
>>> |   | layouts/
>>> |   | modules/
>>> |   | lang/
>>> |en_US.properties
>>> |   | public/
>>>

Re: [Dev] How can we add multi language support in javascript files

2017-03-24 Thread Nuwan Dias
On Fri, Mar 24, 2017 at 1:23 PM, Ruwan Abeykoon  wrote:

> Hi All,
> What if,
> i18n is handled on the server side only, and encode the relevant localized
> strings into HTML by the server-side (js or hbs).
> Client side libraries only read the string values already in the client
> locale within HTML DOM itself and just render the data. No client-side i18n.
>
> What is would be the limitations?
>

Limitations would be for SPAs where the rendering is done at the client
side. Which would basically mean that SPAs can't have localization.

>
> Cheers,
> Ruwan
>
> On Fri, Mar 24, 2017 at 11:54 AM, Nipuna Chandradasa 
> wrote:
>
>> API of somekind(Rest or a http service endpoint), That we have to think
>> about,  that exposes a functionality to retrieve i18n as a json object to
>> layout level or any other global level of the application. So on client
>> side we can use the i18n language details anywhere.
>> We can get the language data from the browser.. that's how we do it
>> anyway i think. We get the i18n based on the what language browser has
>> configured to use.
>>
>> Thank you,
>>
>> On Fri, Mar 24, 2017 at 10:14 AM, Prasanna Dangalla 
>> wrote:
>>
>>> On Fri, Mar 24, 2017 at 12:53 AM, Nipuna Chandradasa 
>>> wrote:
>>>
 I don't think there is a feasible solution rather than loading i18n
 config file as a json object to the client side in the beginning of the
 app... i think from uuf side we can provide a api for that... WDYT?

>>> API in the sense, what kind of an API ? Does this loads all the data
>>> into front end or are you thinking about a filtering mechanism for the
>>> language data by page before you send them to front end ?
>>>
>>>
>>> On Thu, Mar 23, 2017 at 5:29 PM, SajithAR Ariyarathna >> > wrote:
>>>
 Currently UUF doesn't support i18n in client-side.

 @UUF Team,
 We need to come up with a solution for client-side i18n. Shall we start
 a discussion on this?

 Thanks.


 On Thu, Mar 23, 2017 at 4:36 PM, Prasanna Dangalla 
 wrote:

> Hi Sajith,
>
> This is for Client-side JS
>
> *Prasanna Dangalla*
> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
> lean.enterprise.middleware
>
>
> *cell: +94 718 11 27 51*
> *twitter: @prasa77*
>
> On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna <
> sajit...@wso2.com> wrote:
>
>> Hi Prasanna,
>>
>> Is there a mechanism defined to use something like i18n in
>>> javascript ?
>>
>> Server-side JS or Client-side JS?
>>
>> On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka > > wrote:
>>
>>> Hi Prasanna,
>>>
>>> Similar discussion was started sometime back in [1].
>>> Issues in [2], [3] have some suggestions.
>>>
>>> [1] [Dev][UUF][IS-6] Enable i18n support in javascript
>>> [2] https://github.com/wso2/carbon-uuf/issues/160
>>> [3] https://github.com/wso2/carbon-uuf/issues/166
>>>
>>> @Ayesha: As I understood all these are done for server side JS, I'm
> wondering about client side JS.
>
>
>>
>>> On Thu, Mar 23, 2017 at 10:46 AM, Pubudu Gunatilaka <
>>> pubu...@wso2.com> wrote:
>>>
 Adding Manu and Sajith.

 On Thu, Mar 23, 2017 at 10:44 AM, Prasanna Dangalla <
 prasa...@wso2.com> wrote:

> Hi Nisala,
>
> I was wondering how to include this in javascript files, not in
> hbs files. Is there a way to include in javascrip fiels ?
>
> Thanks
>
> *Prasanna Dangalla*
> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
> lean.enterprise.middleware
>
>
> *cell: +94 718 11 27 51*
> *twitter: @prasa77*
>
> On Thu, Mar 23, 2017 at 10:33 AM, Nisala Nanayakkara <
> nis...@wso2.com> wrote:
>
>> Hi Prasanna,
>>
>> UUF has the capability of facilitating above mentioned scenario.
>> You can define your language property file under the ‘lang’ 
>> directory as
>> follows.
>>
>> |src
>> | |main
>> |   | pages/
>> |   | fragments/
>> |   | layouts/
>> |   | modules/
>> |   | lang/
>> |en_US.properties
>> |   | public/
>>
>> After that you can use following code segment to achieve your
>> requirement in your hbs file.
>>
>> {{i18n "my.sample.key"}}
>>
>> Please go through sample app available here[1] if you need more
>> clarification. Moreover you can find actual usage above code segment
>> 

Re: [Dev] How can we add multi language support in javascript files

2017-03-24 Thread Ruwan Abeykoon
Hi All,
What if,
i18n is handled on the server side only, and encode the relevant localized
strings into HTML by the server-side (js or hbs).
Client side libraries only read the string values already in the client
locale within HTML DOM itself and just render the data. No client-side i18n.

What is would be the limitations?

Cheers,
Ruwan

On Fri, Mar 24, 2017 at 11:54 AM, Nipuna Chandradasa 
wrote:

> API of somekind(Rest or a http service endpoint), That we have to think
> about,  that exposes a functionality to retrieve i18n as a json object to
> layout level or any other global level of the application. So on client
> side we can use the i18n language details anywhere.
> We can get the language data from the browser.. that's how we do it anyway
> i think. We get the i18n based on the what language browser has configured
> to use.
>
> Thank you,
>
> On Fri, Mar 24, 2017 at 10:14 AM, Prasanna Dangalla 
> wrote:
>
>> On Fri, Mar 24, 2017 at 12:53 AM, Nipuna Chandradasa 
>> wrote:
>>
>>> I don't think there is a feasible solution rather than loading i18n
>>> config file as a json object to the client side in the beginning of the
>>> app... i think from uuf side we can provide a api for that... WDYT?
>>>
>> API in the sense, what kind of an API ? Does this loads all the data into
>> front end or are you thinking about a filtering mechanism for the language
>> data by page before you send them to front end ?
>>
>>
>> On Thu, Mar 23, 2017 at 5:29 PM, SajithAR Ariyarathna 
>> wrote:
>>
>>> Currently UUF doesn't support i18n in client-side.
>>>
>>> @UUF Team,
>>> We need to come up with a solution for client-side i18n. Shall we start
>>> a discussion on this?
>>>
>>> Thanks.
>>>
>>>
>>> On Thu, Mar 23, 2017 at 4:36 PM, Prasanna Dangalla 
>>> wrote:
>>>
 Hi Sajith,

 This is for Client-side JS

 *Prasanna Dangalla*
 Senior Software Engineer, WSO2, Inc.; http://wso2.com/
 lean.enterprise.middleware


 *cell: +94 718 11 27 51*
 *twitter: @prasa77*

 On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna <
 sajit...@wso2.com> wrote:

> Hi Prasanna,
>
> Is there a mechanism defined to use something like i18n in javascript
>> ?
>
> Server-side JS or Client-side JS?
>
> On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka 
> wrote:
>
>> Hi Prasanna,
>>
>> Similar discussion was started sometime back in [1].
>> Issues in [2], [3] have some suggestions.
>>
>> [1] [Dev][UUF][IS-6] Enable i18n support in javascript
>> [2] https://github.com/wso2/carbon-uuf/issues/160
>> [3] https://github.com/wso2/carbon-uuf/issues/166
>>
>> @Ayesha: As I understood all these are done for server side JS, I'm
 wondering about client side JS.


>
>> On Thu, Mar 23, 2017 at 10:46 AM, Pubudu Gunatilaka > > wrote:
>>
>>> Adding Manu and Sajith.
>>>
>>> On Thu, Mar 23, 2017 at 10:44 AM, Prasanna Dangalla <
>>> prasa...@wso2.com> wrote:
>>>
 Hi Nisala,

 I was wondering how to include this in javascript files, not in hbs
 files. Is there a way to include in javascrip fiels ?

 Thanks

 *Prasanna Dangalla*
 Senior Software Engineer, WSO2, Inc.; http://wso2.com/
 lean.enterprise.middleware


 *cell: +94 718 11 27 51*
 *twitter: @prasa77*

 On Thu, Mar 23, 2017 at 10:33 AM, Nisala Nanayakkara <
 nis...@wso2.com> wrote:

> Hi Prasanna,
>
> UUF has the capability of facilitating above mentioned scenario.
> You can define your language property file under the ‘lang’ directory 
> as
> follows.
>
> |src
> | |main
> |   | pages/
> |   | fragments/
> |   | layouts/
> |   | modules/
> |   | lang/
> |en_US.properties
> |   | public/
>
> After that you can use following code segment to achieve your
> requirement in your hbs file.
>
> {{i18n "my.sample.key"}}
>
> Please go through sample app available here[1] if you need more
> clarification. Moreover you can find actual usage above code segment
> here[2] and corresponding language file here[3].
>
> [1] - https://github.com/wso2/carbon-uuf/tree/master/samples/apps/
> org.wso2.carbon.uuf.sample.pets-store.app
> [2] - https://github.com/wso2/carbon-uuf/blob/master/samples/apps/
> org.wso2.carbon.uuf.sample.pets-store.app/src/main/pages/ind
> ex.hbs#L16
> [3] - 

Re: [Dev] How can we add multi language support in javascript files

2017-03-24 Thread Nipuna Chandradasa
API of somekind(Rest or a http service endpoint), That we have to think
about,  that exposes a functionality to retrieve i18n as a json object to
layout level or any other global level of the application. So on client
side we can use the i18n language details anywhere.
We can get the language data from the browser.. that's how we do it anyway
i think. We get the i18n based on the what language browser has configured
to use.

Thank you,

On Fri, Mar 24, 2017 at 10:14 AM, Prasanna Dangalla 
wrote:

> On Fri, Mar 24, 2017 at 12:53 AM, Nipuna Chandradasa 
> wrote:
>
>> I don't think there is a feasible solution rather than loading i18n
>> config file as a json object to the client side in the beginning of the
>> app... i think from uuf side we can provide a api for that... WDYT?
>>
> API in the sense, what kind of an API ? Does this loads all the data into
> front end or are you thinking about a filtering mechanism for the language
> data by page before you send them to front end ?
>
>
> On Thu, Mar 23, 2017 at 5:29 PM, SajithAR Ariyarathna 
> wrote:
>
>> Currently UUF doesn't support i18n in client-side.
>>
>> @UUF Team,
>> We need to come up with a solution for client-side i18n. Shall we start a
>> discussion on this?
>>
>> Thanks.
>>
>>
>> On Thu, Mar 23, 2017 at 4:36 PM, Prasanna Dangalla 
>> wrote:
>>
>>> Hi Sajith,
>>>
>>> This is for Client-side JS
>>>
>>> *Prasanna Dangalla*
>>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>>> lean.enterprise.middleware
>>>
>>>
>>> *cell: +94 718 11 27 51*
>>> *twitter: @prasa77*
>>>
>>> On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna >> > wrote:
>>>
 Hi Prasanna,

 Is there a mechanism defined to use something like i18n in javascript ?

 Server-side JS or Client-side JS?

 On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka 
 wrote:

> Hi Prasanna,
>
> Similar discussion was started sometime back in [1].
> Issues in [2], [3] have some suggestions.
>
> [1] [Dev][UUF][IS-6] Enable i18n support in javascript
> [2] https://github.com/wso2/carbon-uuf/issues/160
> [3] https://github.com/wso2/carbon-uuf/issues/166
>
> @Ayesha: As I understood all these are done for server side JS, I'm
>>> wondering about client side JS.
>>>
>>>

> On Thu, Mar 23, 2017 at 10:46 AM, Pubudu Gunatilaka 
> wrote:
>
>> Adding Manu and Sajith.
>>
>> On Thu, Mar 23, 2017 at 10:44 AM, Prasanna Dangalla <
>> prasa...@wso2.com> wrote:
>>
>>> Hi Nisala,
>>>
>>> I was wondering how to include this in javascript files, not in hbs
>>> files. Is there a way to include in javascrip fiels ?
>>>
>>> Thanks
>>>
>>> *Prasanna Dangalla*
>>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>>> lean.enterprise.middleware
>>>
>>>
>>> *cell: +94 718 11 27 51*
>>> *twitter: @prasa77*
>>>
>>> On Thu, Mar 23, 2017 at 10:33 AM, Nisala Nanayakkara <
>>> nis...@wso2.com> wrote:
>>>
 Hi Prasanna,

 UUF has the capability of facilitating above mentioned scenario.
 You can define your language property file under the ‘lang’ directory 
 as
 follows.

 |src
 | |main
 |   | pages/
 |   | fragments/
 |   | layouts/
 |   | modules/
 |   | lang/
 |en_US.properties
 |   | public/

 After that you can use following code segment to achieve your
 requirement in your hbs file.

 {{i18n "my.sample.key"}}

 Please go through sample app available here[1] if you need more
 clarification. Moreover you can find actual usage above code segment
 here[2] and corresponding language file here[3].

 [1] - https://github.com/wso2/carbon-uuf/tree/master/samples/apps/
 org.wso2.carbon.uuf.sample.pets-store.app
 [2] - https://github.com/wso2/carbon-uuf/blob/master/samples/apps/
 org.wso2.carbon.uuf.sample.pets-store.app/src/main/pages/ind
 ex.hbs#L16
 [3] - https://github.com/wso2/carbon-uuf/blob/master/samples/apps/
 org.wso2.carbon.uuf.sample.pets-store.app/src/main/lang/en_U
 S.properties

 Thanks,
 Nisala

 On Thu, Mar 23, 2017 at 9:01 AM, Prasanna Dangalla <
 prasa...@wso2.com> wrote:

> Hi Devs,
>
> Is there a mechanism defined to use something like i18n in
> javascript ? Does the UUF has the capability of facilitating this ? 
> You
> inputs are highly appreciated.
>
> Thanks
>

Re: [Dev] How can we add multi language support in javascript files

2017-03-23 Thread Prasanna Dangalla
On Fri, Mar 24, 2017 at 12:53 AM, Nipuna Chandradasa 
wrote:

> I don't think there is a feasible solution rather than loading i18n config
> file as a json object to the client side in the beginning of the app... i
> think from uuf side we can provide a api for that... WDYT?
>
API in the sense, what kind of an API ? Does this loads all the data into
front end or are you thinking about a filtering mechanism for the language
data by page before you send them to front end ?

On Thu, Mar 23, 2017 at 5:29 PM, SajithAR Ariyarathna 
wrote:

> Currently UUF doesn't support i18n in client-side.
>
> @UUF Team,
> We need to come up with a solution for client-side i18n. Shall we start a
> discussion on this?
>
> Thanks.
>
>
> On Thu, Mar 23, 2017 at 4:36 PM, Prasanna Dangalla 
> wrote:
>
>> Hi Sajith,
>>
>> This is for Client-side JS
>>
>> *Prasanna Dangalla*
>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>> lean.enterprise.middleware
>>
>>
>> *cell: +94 718 11 27 51*
>> *twitter: @prasa77*
>>
>> On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna 
>> wrote:
>>
>>> Hi Prasanna,
>>>
>>> Is there a mechanism defined to use something like i18n in javascript ?
>>>
>>> Server-side JS or Client-side JS?
>>>
>>> On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka 
>>> wrote:
>>>
 Hi Prasanna,

 Similar discussion was started sometime back in [1].
 Issues in [2], [3] have some suggestions.

 [1] [Dev][UUF][IS-6] Enable i18n support in javascript
 [2] https://github.com/wso2/carbon-uuf/issues/160
 [3] https://github.com/wso2/carbon-uuf/issues/166

 @Ayesha: As I understood all these are done for server side JS, I'm
>> wondering about client side JS.
>>
>>
>>>
 On Thu, Mar 23, 2017 at 10:46 AM, Pubudu Gunatilaka 
 wrote:

> Adding Manu and Sajith.
>
> On Thu, Mar 23, 2017 at 10:44 AM, Prasanna Dangalla  > wrote:
>
>> Hi Nisala,
>>
>> I was wondering how to include this in javascript files, not in hbs
>> files. Is there a way to include in javascrip fiels ?
>>
>> Thanks
>>
>> *Prasanna Dangalla*
>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>> lean.enterprise.middleware
>>
>>
>> *cell: +94 718 11 27 51*
>> *twitter: @prasa77*
>>
>> On Thu, Mar 23, 2017 at 10:33 AM, Nisala Nanayakkara > > wrote:
>>
>>> Hi Prasanna,
>>>
>>> UUF has the capability of facilitating above mentioned scenario. You
>>> can define your language property file under the ‘lang’ directory as
>>> follows.
>>>
>>> |src
>>> | |main
>>> |   | pages/
>>> |   | fragments/
>>> |   | layouts/
>>> |   | modules/
>>> |   | lang/
>>> |en_US.properties
>>> |   | public/
>>>
>>> After that you can use following code segment to achieve your
>>> requirement in your hbs file.
>>>
>>> {{i18n "my.sample.key"}}
>>>
>>> Please go through sample app available here[1] if you need more
>>> clarification. Moreover you can find actual usage above code segment
>>> here[2] and corresponding language file here[3].
>>>
>>> [1] - https://github.com/wso2/carbon-uuf/tree/master/samples/apps/
>>> org.wso2.carbon.uuf.sample.pets-store.app
>>> [2] - https://github.com/wso2/carbon-uuf/blob/master/samples/apps/
>>> org.wso2.carbon.uuf.sample.pets-store.app/src/main/pages/ind
>>> ex.hbs#L16
>>> [3] - https://github.com/wso2/carbon-uuf/blob/master/samples/apps/
>>> org.wso2.carbon.uuf.sample.pets-store.app/src/main/lang/en_U
>>> S.properties
>>>
>>> Thanks,
>>> Nisala
>>>
>>> On Thu, Mar 23, 2017 at 9:01 AM, Prasanna Dangalla <
>>> prasa...@wso2.com> wrote:
>>>
 Hi Devs,

 Is there a mechanism defined to use something like i18n in
 javascript ? Does the UUF has the capability of facilitating this ? You
 inputs are highly appreciated.

 Thanks

 *Prasanna Dangalla*
 Senior Software Engineer, WSO2, Inc.; http://wso2.com/
 lean.enterprise.middleware


 *cell: +94 718 11 27 51*
 *twitter: @prasa77*

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>>
>>>
>>> --
>>> *Nisala Niroshana Nanayakkara,*
>>> Software Engineer
>>> Mobile:(+94)717600022
>>> WSO2 Inc., http://wso2.com/
>>>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> 

Re: [Dev] How can we add multi language support in javascript files

2017-03-23 Thread Nipuna Chandradasa
I don't think there is a feasible solution rather than loading i18n config
file as a json object to the client side in the beginning of the app... i
think from uuf side we can provide a api for that... WDYT?

On Thu, Mar 23, 2017 at 5:29 PM, SajithAR Ariyarathna 
wrote:

> Currently UUF doesn't support i18n in client-side.
>
> @UUF Team,
> We need to come up with a solution for client-side i18n. Shall we start a
> discussion on this?
>
> Thanks.
>
>
> On Thu, Mar 23, 2017 at 4:36 PM, Prasanna Dangalla 
> wrote:
>
>> Hi Sajith,
>>
>> This is for Client-side JS
>>
>> *Prasanna Dangalla*
>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>> lean.enterprise.middleware
>>
>>
>> *cell: +94 718 11 27 51*
>> *twitter: @prasa77*
>>
>> On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna 
>> wrote:
>>
>>> Hi Prasanna,
>>>
>>> Is there a mechanism defined to use something like i18n in javascript ?
>>>
>>> Server-side JS or Client-side JS?
>>>
>>> On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka 
>>> wrote:
>>>
 Hi Prasanna,

 Similar discussion was started sometime back in [1].
 Issues in [2], [3] have some suggestions.

 [1] [Dev][UUF][IS-6] Enable i18n support in javascript
 [2] https://github.com/wso2/carbon-uuf/issues/160
 [3] https://github.com/wso2/carbon-uuf/issues/166

 @Ayesha: As I understood all these are done for server side JS, I'm
>> wondering about client side JS.
>>
>>
>>>
 On Thu, Mar 23, 2017 at 10:46 AM, Pubudu Gunatilaka 
 wrote:

> Adding Manu and Sajith.
>
> On Thu, Mar 23, 2017 at 10:44 AM, Prasanna Dangalla  > wrote:
>
>> Hi Nisala,
>>
>> I was wondering how to include this in javascript files, not in hbs
>> files. Is there a way to include in javascrip fiels ?
>>
>> Thanks
>>
>> *Prasanna Dangalla*
>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>> lean.enterprise.middleware
>>
>>
>> *cell: +94 718 11 27 51*
>> *twitter: @prasa77*
>>
>> On Thu, Mar 23, 2017 at 10:33 AM, Nisala Nanayakkara > > wrote:
>>
>>> Hi Prasanna,
>>>
>>> UUF has the capability of facilitating above mentioned scenario. You
>>> can define your language property file under the ‘lang’ directory as
>>> follows.
>>>
>>> |src
>>> | |main
>>> |   | pages/
>>> |   | fragments/
>>> |   | layouts/
>>> |   | modules/
>>> |   | lang/
>>> |en_US.properties
>>> |   | public/
>>>
>>> After that you can use following code segment to achieve your
>>> requirement in your hbs file.
>>>
>>> {{i18n "my.sample.key"}}
>>>
>>> Please go through sample app available here[1] if you need more
>>> clarification. Moreover you can find actual usage above code segment
>>> here[2] and corresponding language file here[3].
>>>
>>> [1] - https://github.com/wso2/carbon-uuf/tree/master/samples/apps/
>>> org.wso2.carbon.uuf.sample.pets-store.app
>>> [2] - https://github.com/wso2/carbon-uuf/blob/master/samples/apps/
>>> org.wso2.carbon.uuf.sample.pets-store.app/src/main/pages/ind
>>> ex.hbs#L16
>>> [3] - https://github.com/wso2/carbon-uuf/blob/master/samples/apps/
>>> org.wso2.carbon.uuf.sample.pets-store.app/src/main/lang/en_U
>>> S.properties
>>>
>>> Thanks,
>>> Nisala
>>>
>>> On Thu, Mar 23, 2017 at 9:01 AM, Prasanna Dangalla <
>>> prasa...@wso2.com> wrote:
>>>
 Hi Devs,

 Is there a mechanism defined to use something like i18n in
 javascript ? Does the UUF has the capability of facilitating this ? You
 inputs are highly appreciated.

 Thanks

 *Prasanna Dangalla*
 Senior Software Engineer, WSO2, Inc.; http://wso2.com/
 lean.enterprise.middleware


 *cell: +94 718 11 27 51*
 *twitter: @prasa77*

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>>
>>>
>>> --
>>> *Nisala Niroshana Nanayakkara,*
>>> Software Engineer
>>> Mobile:(+94)717600022
>>> WSO2 Inc., http://wso2.com/
>>>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Pubudu Gunatilaka*
> Committer and PMC Member - Apache Stratos
> Software Engineer
> WSO2, Inc.: http://wso2.com
> mobile : +94774078049 <%2B94772207163>
>
>
> 

Re: [Dev] How can we add multi language support in javascript files

2017-03-23 Thread SajithAR Ariyarathna
Currently UUF doesn't support i18n in client-side.

@UUF Team,
We need to come up with a solution for client-side i18n. Shall we start a
discussion on this?

Thanks.

On Thu, Mar 23, 2017 at 4:36 PM, Prasanna Dangalla 
wrote:

> Hi Sajith,
>
> This is for Client-side JS
>
> *Prasanna Dangalla*
> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
> lean.enterprise.middleware
>
>
> *cell: +94 718 11 27 51*
> *twitter: @prasa77*
>
> On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna 
> wrote:
>
>> Hi Prasanna,
>>
>> Is there a mechanism defined to use something like i18n in javascript ?
>>
>> Server-side JS or Client-side JS?
>>
>> On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka 
>> wrote:
>>
>>> Hi Prasanna,
>>>
>>> Similar discussion was started sometime back in [1].
>>> Issues in [2], [3] have some suggestions.
>>>
>>> [1] [Dev][UUF][IS-6] Enable i18n support in javascript
>>> [2] https://github.com/wso2/carbon-uuf/issues/160
>>> [3] https://github.com/wso2/carbon-uuf/issues/166
>>>
>>> @Ayesha: As I understood all these are done for server side JS, I'm
> wondering about client side JS.
>
>
>>
>>> On Thu, Mar 23, 2017 at 10:46 AM, Pubudu Gunatilaka 
>>> wrote:
>>>
 Adding Manu and Sajith.

 On Thu, Mar 23, 2017 at 10:44 AM, Prasanna Dangalla 
 wrote:

> Hi Nisala,
>
> I was wondering how to include this in javascript files, not in hbs
> files. Is there a way to include in javascrip fiels ?
>
> Thanks
>
> *Prasanna Dangalla*
> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
> lean.enterprise.middleware
>
>
> *cell: +94 718 11 27 51*
> *twitter: @prasa77*
>
> On Thu, Mar 23, 2017 at 10:33 AM, Nisala Nanayakkara 
> wrote:
>
>> Hi Prasanna,
>>
>> UUF has the capability of facilitating above mentioned scenario. You
>> can define your language property file under the ‘lang’ directory as
>> follows.
>>
>> |src
>> | |main
>> |   | pages/
>> |   | fragments/
>> |   | layouts/
>> |   | modules/
>> |   | lang/
>> |en_US.properties
>> |   | public/
>>
>> After that you can use following code segment to achieve your
>> requirement in your hbs file.
>>
>> {{i18n "my.sample.key"}}
>>
>> Please go through sample app available here[1] if you need more
>> clarification. Moreover you can find actual usage above code segment
>> here[2] and corresponding language file here[3].
>>
>> [1] - https://github.com/wso2/carbon-uuf/tree/master/samples/apps/
>> org.wso2.carbon.uuf.sample.pets-store.app
>> [2] - https://github.com/wso2/carbon-uuf/blob/master/samples/apps/
>> org.wso2.carbon.uuf.sample.pets-store.app/src/main/pages/ind
>> ex.hbs#L16
>> [3] - https://github.com/wso2/carbon-uuf/blob/master/samples/apps/
>> org.wso2.carbon.uuf.sample.pets-store.app/src/main/lang/en_U
>> S.properties
>>
>> Thanks,
>> Nisala
>>
>> On Thu, Mar 23, 2017 at 9:01 AM, Prasanna Dangalla > > wrote:
>>
>>> Hi Devs,
>>>
>>> Is there a mechanism defined to use something like i18n in
>>> javascript ? Does the UUF has the capability of facilitating this ? You
>>> inputs are highly appreciated.
>>>
>>> Thanks
>>>
>>> *Prasanna Dangalla*
>>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>>> lean.enterprise.middleware
>>>
>>>
>>> *cell: +94 718 11 27 51*
>>> *twitter: @prasa77*
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Nisala Niroshana Nanayakkara,*
>> Software Engineer
>> Mobile:(+94)717600022
>> WSO2 Inc., http://wso2.com/
>>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


 --
 *Pubudu Gunatilaka*
 Committer and PMC Member - Apache Stratos
 Software Engineer
 WSO2, Inc.: http://wso2.com
 mobile : +94774078049 <%2B94772207163>


 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>>
>>>
>>> --
>>> *Ayesha Dissanayaka*
>>> Senior Software Engineer,
>>> WSO2, Inc : http://wso2.com
>>> 
>>> 20, Palm grove Avenue, Colombo 3
>>> E-Mail: aye...@wso2.com 
>>>
>>
>>
>>
>> --
>> Sajith Janaprasad Ariyarathna
>> 

Re: [Dev] How can we add multi language support in javascript files

2017-03-23 Thread Prasanna Dangalla
Hi Sajith,

This is for Client-side JS

*Prasanna Dangalla*
Senior Software Engineer, WSO2, Inc.; http://wso2.com/
lean.enterprise.middleware


*cell: +94 718 11 27 51*
*twitter: @prasa77*

On Thu, Mar 23, 2017 at 2:54 PM, SajithAR Ariyarathna 
wrote:

> Hi Prasanna,
>
> Is there a mechanism defined to use something like i18n in javascript ?
>
> Server-side JS or Client-side JS?
>
> On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka 
> wrote:
>
>> Hi Prasanna,
>>
>> Similar discussion was started sometime back in [1].
>> Issues in [2], [3] have some suggestions.
>>
>> [1] [Dev][UUF][IS-6] Enable i18n support in javascript
>> [2] https://github.com/wso2/carbon-uuf/issues/160
>> [3] https://github.com/wso2/carbon-uuf/issues/166
>>
>> @Ayesha: As I understood all these are done for server side JS, I'm
wondering about client side JS.


>
>> On Thu, Mar 23, 2017 at 10:46 AM, Pubudu Gunatilaka 
>> wrote:
>>
>>> Adding Manu and Sajith.
>>>
>>> On Thu, Mar 23, 2017 at 10:44 AM, Prasanna Dangalla 
>>> wrote:
>>>
 Hi Nisala,

 I was wondering how to include this in javascript files, not in hbs
 files. Is there a way to include in javascrip fiels ?

 Thanks

 *Prasanna Dangalla*
 Senior Software Engineer, WSO2, Inc.; http://wso2.com/
 lean.enterprise.middleware


 *cell: +94 718 11 27 51*
 *twitter: @prasa77*

 On Thu, Mar 23, 2017 at 10:33 AM, Nisala Nanayakkara 
 wrote:

> Hi Prasanna,
>
> UUF has the capability of facilitating above mentioned scenario. You
> can define your language property file under the ‘lang’ directory as
> follows.
>
> |src
> | |main
> |   | pages/
> |   | fragments/
> |   | layouts/
> |   | modules/
> |   | lang/
> |en_US.properties
> |   | public/
>
> After that you can use following code segment to achieve your
> requirement in your hbs file.
>
> {{i18n "my.sample.key"}}
>
> Please go through sample app available here[1] if you need more
> clarification. Moreover you can find actual usage above code segment
> here[2] and corresponding language file here[3].
>
> [1] - https://github.com/wso2/carbon-uuf/tree/master/samples/apps/
> org.wso2.carbon.uuf.sample.pets-store.app
> [2] - https://github.com/wso2/carbon-uuf/blob/master/samples/apps/
> org.wso2.carbon.uuf.sample.pets-store.app/src/main/pages/index.hbs#L16
> [3] - https://github.com/wso2/carbon-uuf/blob/master/samples/apps/
> org.wso2.carbon.uuf.sample.pets-store.app/src/main/lang/en_U
> S.properties
>
> Thanks,
> Nisala
>
> On Thu, Mar 23, 2017 at 9:01 AM, Prasanna Dangalla 
> wrote:
>
>> Hi Devs,
>>
>> Is there a mechanism defined to use something like i18n in
>> javascript ? Does the UUF has the capability of facilitating this ? You
>> inputs are highly appreciated.
>>
>> Thanks
>>
>> *Prasanna Dangalla*
>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>> lean.enterprise.middleware
>>
>>
>> *cell: +94 718 11 27 51*
>> *twitter: @prasa77*
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Nisala Niroshana Nanayakkara,*
> Software Engineer
> Mobile:(+94)717600022
> WSO2 Inc., http://wso2.com/
>


 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>>
>>>
>>> --
>>> *Pubudu Gunatilaka*
>>> Committer and PMC Member - Apache Stratos
>>> Software Engineer
>>> WSO2, Inc.: http://wso2.com
>>> mobile : +94774078049 <%2B94772207163>
>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Ayesha Dissanayaka*
>> Senior Software Engineer,
>> WSO2, Inc : http://wso2.com
>> 
>> 20, Palm grove Avenue, Colombo 3
>> E-Mail: aye...@wso2.com 
>>
>
>
>
> --
> Sajith Janaprasad Ariyarathna
> Software Engineer; WSO2, Inc.;  http://wso2.com/
> 
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How can we add multi language support in javascript files

2017-03-23 Thread SajithAR Ariyarathna
Hi Prasanna,

Is there a mechanism defined to use something like i18n in javascript ?

Server-side JS or Client-side JS?

On Thu, Mar 23, 2017 at 11:02 AM, Ayesha Dissanayaka 
wrote:

> Hi Prasanna,
>
> Similar discussion was started sometime back in [1].
> Issues in [2], [3] have some suggestions.
>
> [1] [Dev][UUF][IS-6] Enable i18n support in javascript
> [2] https://github.com/wso2/carbon-uuf/issues/160
> [3] https://github.com/wso2/carbon-uuf/issues/166
>
>
> On Thu, Mar 23, 2017 at 10:46 AM, Pubudu Gunatilaka 
> wrote:
>
>> Adding Manu and Sajith.
>>
>> On Thu, Mar 23, 2017 at 10:44 AM, Prasanna Dangalla 
>> wrote:
>>
>>> Hi Nisala,
>>>
>>> I was wondering how to include this in javascript files, not in hbs
>>> files. Is there a way to include in javascrip fiels ?
>>>
>>> Thanks
>>>
>>> *Prasanna Dangalla*
>>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>>> lean.enterprise.middleware
>>>
>>>
>>> *cell: +94 718 11 27 51*
>>> *twitter: @prasa77*
>>>
>>> On Thu, Mar 23, 2017 at 10:33 AM, Nisala Nanayakkara 
>>> wrote:
>>>
 Hi Prasanna,

 UUF has the capability of facilitating above mentioned scenario. You
 can define your language property file under the ‘lang’ directory as
 follows.

 |src
 | |main
 |   | pages/
 |   | fragments/
 |   | layouts/
 |   | modules/
 |   | lang/
 |en_US.properties
 |   | public/

 After that you can use following code segment to achieve your
 requirement in your hbs file.

 {{i18n "my.sample.key"}}

 Please go through sample app available here[1] if you need more
 clarification. Moreover you can find actual usage above code segment
 here[2] and corresponding language file here[3].

 [1] - https://github.com/wso2/carbon-uuf/tree/master/samples/apps/
 org.wso2.carbon.uuf.sample.pets-store.app
 [2] - https://github.com/wso2/carbon-uuf/blob/master/samples/apps/
 org.wso2.carbon.uuf.sample.pets-store.app/src/main/pages/index.hbs#L16
 [3] - https://github.com/wso2/carbon-uuf/blob/master/samples/apps/
 org.wso2.carbon.uuf.sample.pets-store.app/src/main/lang/en_U
 S.properties

 Thanks,
 Nisala

 On Thu, Mar 23, 2017 at 9:01 AM, Prasanna Dangalla 
 wrote:

> Hi Devs,
>
> Is there a mechanism defined to use something like i18n in javascript
> ? Does the UUF has the capability of facilitating this ? You inputs are
> highly appreciated.
>
> Thanks
>
> *Prasanna Dangalla*
> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
> lean.enterprise.middleware
>
>
> *cell: +94 718 11 27 51*
> *twitter: @prasa77*
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


 --
 *Nisala Niroshana Nanayakkara,*
 Software Engineer
 Mobile:(+94)717600022
 WSO2 Inc., http://wso2.com/

>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Pubudu Gunatilaka*
>> Committer and PMC Member - Apache Stratos
>> Software Engineer
>> WSO2, Inc.: http://wso2.com
>> mobile : +94774078049 <%2B94772207163>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Ayesha Dissanayaka*
> Senior Software Engineer,
> WSO2, Inc : http://wso2.com
> 
> 20, Palm grove Avenue, Colombo 3
> E-Mail: aye...@wso2.com 
>



-- 
Sajith Janaprasad Ariyarathna
Software Engineer; WSO2, Inc.;  http://wso2.com/

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How can we add multi language support in javascript files

2017-03-22 Thread Ayesha Dissanayaka
Hi Prasanna,

Similar discussion was started sometime back in [1].
Issues in [2], [3] have some suggestions.

[1] [Dev][UUF][IS-6] Enable i18n support in javascript
[2] https://github.com/wso2/carbon-uuf/issues/160
[3] https://github.com/wso2/carbon-uuf/issues/166


On Thu, Mar 23, 2017 at 10:46 AM, Pubudu Gunatilaka 
wrote:

> Adding Manu and Sajith.
>
> On Thu, Mar 23, 2017 at 10:44 AM, Prasanna Dangalla 
> wrote:
>
>> Hi Nisala,
>>
>> I was wondering how to include this in javascript files, not in hbs
>> files. Is there a way to include in javascrip fiels ?
>>
>> Thanks
>>
>> *Prasanna Dangalla*
>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>> lean.enterprise.middleware
>>
>>
>> *cell: +94 718 11 27 51*
>> *twitter: @prasa77*
>>
>> On Thu, Mar 23, 2017 at 10:33 AM, Nisala Nanayakkara 
>> wrote:
>>
>>> Hi Prasanna,
>>>
>>> UUF has the capability of facilitating above mentioned scenario. You can
>>> define your language property file under the ‘lang’ directory as follows.
>>>
>>> |src
>>> | |main
>>> |   | pages/
>>> |   | fragments/
>>> |   | layouts/
>>> |   | modules/
>>> |   | lang/
>>> |en_US.properties
>>> |   | public/
>>>
>>> After that you can use following code segment to achieve your
>>> requirement in your hbs file.
>>>
>>> {{i18n "my.sample.key"}}
>>>
>>> Please go through sample app available here[1] if you need more
>>> clarification. Moreover you can find actual usage above code segment
>>> here[2] and corresponding language file here[3].
>>>
>>> [1] - https://github.com/wso2/carbon-uuf/tree/master/samples/apps/
>>> org.wso2.carbon.uuf.sample.pets-store.app
>>> [2] - https://github.com/wso2/carbon-uuf/blob/master/samples/apps/
>>> org.wso2.carbon.uuf.sample.pets-store.app/src/main/pages/index.hbs#L16
>>> [3] - https://github.com/wso2/carbon-uuf/blob/master/samples/apps/
>>> org.wso2.carbon.uuf.sample.pets-store.app/src/main/lang/en_US.properties
>>>
>>> Thanks,
>>> Nisala
>>>
>>> On Thu, Mar 23, 2017 at 9:01 AM, Prasanna Dangalla 
>>> wrote:
>>>
 Hi Devs,

 Is there a mechanism defined to use something like i18n in javascript
 ? Does the UUF has the capability of facilitating this ? You inputs are
 highly appreciated.

 Thanks

 *Prasanna Dangalla*
 Senior Software Engineer, WSO2, Inc.; http://wso2.com/
 lean.enterprise.middleware


 *cell: +94 718 11 27 51*
 *twitter: @prasa77*

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>>
>>>
>>> --
>>> *Nisala Niroshana Nanayakkara,*
>>> Software Engineer
>>> Mobile:(+94)717600022
>>> WSO2 Inc., http://wso2.com/
>>>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Pubudu Gunatilaka*
> Committer and PMC Member - Apache Stratos
> Software Engineer
> WSO2, Inc.: http://wso2.com
> mobile : +94774078049 <%2B94772207163>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Ayesha Dissanayaka*
Senior Software Engineer,
WSO2, Inc : http://wso2.com

20, Palm grove Avenue, Colombo 3
E-Mail: aye...@wso2.com 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How can we add multi language support in javascript files

2017-03-22 Thread Pubudu Gunatilaka
Adding Manu and Sajith.

On Thu, Mar 23, 2017 at 10:44 AM, Prasanna Dangalla 
wrote:

> Hi Nisala,
>
> I was wondering how to include this in javascript files, not in hbs files.
> Is there a way to include in javascrip fiels ?
>
> Thanks
>
> *Prasanna Dangalla*
> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
> lean.enterprise.middleware
>
>
> *cell: +94 718 11 27 51*
> *twitter: @prasa77*
>
> On Thu, Mar 23, 2017 at 10:33 AM, Nisala Nanayakkara 
> wrote:
>
>> Hi Prasanna,
>>
>> UUF has the capability of facilitating above mentioned scenario. You can
>> define your language property file under the ‘lang’ directory as follows.
>>
>> |src
>> | |main
>> |   | pages/
>> |   | fragments/
>> |   | layouts/
>> |   | modules/
>> |   | lang/
>> |en_US.properties
>> |   | public/
>>
>> After that you can use following code segment to achieve your requirement
>> in your hbs file.
>>
>> {{i18n "my.sample.key"}}
>>
>> Please go through sample app available here[1] if you need more
>> clarification. Moreover you can find actual usage above code segment
>> here[2] and corresponding language file here[3].
>>
>> [1] - https://github.com/wso2/carbon-uuf/tree/master/samples/apps/
>> org.wso2.carbon.uuf.sample.pets-store.app
>> [2] - https://github.com/wso2/carbon-uuf/blob/master/samples/apps/
>> org.wso2.carbon.uuf.sample.pets-store.app/src/main/pages/index.hbs#L16
>> [3] - https://github.com/wso2/carbon-uuf/blob/master/samples/apps/
>> org.wso2.carbon.uuf.sample.pets-store.app/src/main/lang/en_US.properties
>>
>> Thanks,
>> Nisala
>>
>> On Thu, Mar 23, 2017 at 9:01 AM, Prasanna Dangalla 
>> wrote:
>>
>>> Hi Devs,
>>>
>>> Is there a mechanism defined to use something like i18n in javascript ?
>>> Does the UUF has the capability of facilitating this ? You inputs are
>>> highly appreciated.
>>>
>>> Thanks
>>>
>>> *Prasanna Dangalla*
>>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>>> lean.enterprise.middleware
>>>
>>>
>>> *cell: +94 718 11 27 51*
>>> *twitter: @prasa77*
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Nisala Niroshana Nanayakkara,*
>> Software Engineer
>> Mobile:(+94)717600022
>> WSO2 Inc., http://wso2.com/
>>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Pubudu Gunatilaka*
Committer and PMC Member - Apache Stratos
Software Engineer
WSO2, Inc.: http://wso2.com
mobile : +94774078049 <%2B94772207163>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How can we add multi language support in javascript files

2017-03-22 Thread Prasanna Dangalla
Hi Nisala,

I was wondering how to include this in javascript files, not in hbs files.
Is there a way to include in javascrip fiels ?

Thanks

*Prasanna Dangalla*
Senior Software Engineer, WSO2, Inc.; http://wso2.com/
lean.enterprise.middleware


*cell: +94 718 11 27 51*
*twitter: @prasa77*

On Thu, Mar 23, 2017 at 10:33 AM, Nisala Nanayakkara 
wrote:

> Hi Prasanna,
>
> UUF has the capability of facilitating above mentioned scenario. You can
> define your language property file under the ‘lang’ directory as follows.
>
> |src
> | |main
> |   | pages/
> |   | fragments/
> |   | layouts/
> |   | modules/
> |   | lang/
> |en_US.properties
> |   | public/
>
> After that you can use following code segment to achieve your requirement
> in your hbs file.
>
> {{i18n "my.sample.key"}}
>
> Please go through sample app available here[1] if you need more
> clarification. Moreover you can find actual usage above code segment
> here[2] and corresponding language file here[3].
>
> [1] - https://github.com/wso2/carbon-uuf/tree/master/
> samples/apps/org.wso2.carbon.uuf.sample.pets-store.app
> [2] - https://github.com/wso2/carbon-uuf/blob/master/
> samples/apps/org.wso2.carbon.uuf.sample.pets-store.app/src/
> main/pages/index.hbs#L16
> [3] - https://github.com/wso2/carbon-uuf/blob/master/
> samples/apps/org.wso2.carbon.uuf.sample.pets-store.app/src/
> main/lang/en_US.properties
>
> Thanks,
> Nisala
>
> On Thu, Mar 23, 2017 at 9:01 AM, Prasanna Dangalla 
> wrote:
>
>> Hi Devs,
>>
>> Is there a mechanism defined to use something like i18n in javascript ?
>> Does the UUF has the capability of facilitating this ? You inputs are
>> highly appreciated.
>>
>> Thanks
>>
>> *Prasanna Dangalla*
>> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
>> lean.enterprise.middleware
>>
>>
>> *cell: +94 718 11 27 51*
>> *twitter: @prasa77*
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Nisala Niroshana Nanayakkara,*
> Software Engineer
> Mobile:(+94)717600022
> WSO2 Inc., http://wso2.com/
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] How can we add multi language support in javascript files

2017-03-22 Thread Nisala Nanayakkara
Hi Prasanna,

UUF has the capability of facilitating above mentioned scenario. You can
define your language property file under the ‘lang’ directory as follows.

|src
| |main
|   | pages/
|   | fragments/
|   | layouts/
|   | modules/
|   | lang/
|en_US.properties
|   | public/

After that you can use following code segment to achieve your requirement
in your hbs file.

{{i18n "my.sample.key"}}

Please go through sample app available here[1] if you need more
clarification. Moreover you can find actual usage above code segment
here[2] and corresponding language file here[3].

[1] -
https://github.com/wso2/carbon-uuf/tree/master/samples/apps/org.wso2.carbon.uuf.sample.pets-store.app
[2] -
https://github.com/wso2/carbon-uuf/blob/master/samples/apps/org.wso2.carbon.uuf.sample.pets-store.app/src/main/pages/index.hbs#L16
[3] -
https://github.com/wso2/carbon-uuf/blob/master/samples/apps/org.wso2.carbon.uuf.sample.pets-store.app/src/main/lang/en_US.properties

Thanks,
Nisala

On Thu, Mar 23, 2017 at 9:01 AM, Prasanna Dangalla 
wrote:

> Hi Devs,
>
> Is there a mechanism defined to use something like i18n in javascript ?
> Does the UUF has the capability of facilitating this ? You inputs are
> highly appreciated.
>
> Thanks
>
> *Prasanna Dangalla*
> Senior Software Engineer, WSO2, Inc.; http://wso2.com/
> lean.enterprise.middleware
>
>
> *cell: +94 718 11 27 51*
> *twitter: @prasa77*
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Nisala Niroshana Nanayakkara,*
Software Engineer
Mobile:(+94)717600022
WSO2 Inc., http://wso2.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] How can we add multi language support in javascript files

2017-03-22 Thread Prasanna Dangalla
Hi Devs,

Is there a mechanism defined to use something like i18n in javascript ?
Does the UUF has the capability of facilitating this ? You inputs are
highly appreciated.

Thanks

*Prasanna Dangalla*
Senior Software Engineer, WSO2, Inc.; http://wso2.com/
lean.enterprise.middleware


*cell: +94 718 11 27 51*
*twitter: @prasa77*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev