strongloop / strong-globalize

strong-globalize is built on Unicode CLDR and jquery/globalize and implements automatic extraction of strings from JS source code and HTML templates, lint the string resource, machine-translate them in seconds. In runtime, it loads locale and string resource into memory and provides a hook to persistent logging.
Other
25 stars 16 forks source link

Customizing the cldr json file #129

Open blong14 opened 6 years ago

blong14 commented 6 years ago

Hello,

I am having trouble understanding how to add a customized cldr file in my loopback application. My application needs to support the Danish language which does not come out of the box with strong-globalize. I read the README found in the util directory and I think that it is saying that I need to add files directly to the node_modules/strong-globalize/cldr directory. Is that really the case? To alter the node_modules directory directly? I am new to this application but I don't think this approach is possible with how we package and deploy the application to various servers.

Thank you so much for your time.

Ben

raymondfeng commented 6 years ago

Is Danish part of http://cldr.unicode.org/index/downloads?

blong14 commented 6 years ago

@raymondfeng yes from what I can tell. I was able to create the appropriate cldr .json file by updating the util/app.js file to uncomment "da".

raymondfeng commented 6 years ago

I see. Maybe you can maintain your own version of cldr json file and use a npm install script to overwrite strong-gloablize/cldr?

blong14 commented 6 years ago

Ok, I can give that a try. I would also be willing to work on a pull request to add cldr path customization for strong-globalize. I'm wondering if a similar mechanism to SetRootDir could be used? Basically, provide a developer a way to specify where the cldr directory is located.

raymondfeng commented 6 years ago

I'm not the original author of this module. But my guess is that we didn't want to make the json file too big.