Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
48
rated 0 times [  52] [ 4]  / answers: 1 / hits: 21425  / 13 Years ago, mon, november 14, 2011, 12:00:00

I need to develop or find some sort of lightweight gettext-like library in JavaScript for browser-side translations. Preferably the same library could be used by node.js if I'd like to translate server-side instead.



1) But, what are really the pros and cons of using .po files and a JavaScript gettext library?

(As opposed to JSON and jQuery Globalize or similar?)



2) And is there any workflow/service that'll allow crowdsourcing of translations that can be exported to a format (.po/json) that can be used by a JavaScript i18n library (gettext implementation, Globalize.js etc.)?


More From » node.js

 Answers
15

1) But, what are really the pros and cons of using .po files and a JavaScript gettext library?
gettext format is rather common:
- so if your serverside is using gettext format already you might share it with client
- translators might feel more comfortable with gettext format (or yaml) than with json format
- there is a lot of tooling around for it



I personally don't like the translation functions build around gettext - feels clumpsy to me, where lightweight javascript libraries (like http://i18next.com) feel better.



Libs you could use:




  • jed comes with pure gettext implementation

  • i18next supports gettext files but uses a json approach for translation functions



2) And is there any workflow/service that'll allow crowdsourcing of translations that can be exported to a format (.po/json) that can be used by a JavaScript i18n library (gettext implementation, Globalize.js etc.)?




[#89139] Friday, November 11, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aidan

Total Points: 72
Total Questions: 95
Total Answers: 121

Location: Uzbekistan
Member since Sat, Feb 27, 2021
3 Years ago
aidan questions
Mon, Oct 11, 21, 00:00, 3 Years ago
Wed, Sep 29, 21, 00:00, 3 Years ago
Sun, Sep 5, 21, 00:00, 3 Years ago
Thu, Jan 16, 20, 00:00, 4 Years ago
;