TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

FormatJS – Internationalize your web apps on the client and server

181 pointsby juandopazoover 10 years ago

11 comments

cjover 10 years ago
Shameless plug: I&#x27;ve been working on a similar project for about a year now called Localize.js (<a href="https://localizejs.com" rel="nofollow">https:&#x2F;&#x2F;localizejs.com</a>), with the goal of automating the entire process of internationalization &#x2F; localization. It works by scanning the DOM for translatable content, and injecting translations on-the-fly after the page loads (this happens so quickly that the user never sees the text in the original language).
评论 #8454060 未加载
mikewhyover 10 years ago
Are there any advantages over i18n-js[1]? Can&#x27;t say I&#x27;m a huge fan of this method of pluralization:<p><pre><code> Cart: {itemCount} {itemCount, plural, one {item} other {items} } </code></pre> [1]: <a href="https://github.com/fnando/i18n-js" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;fnando&#x2F;i18n-js</a>
评论 #8454443 未加载
评论 #8454526 未加载
MaBuover 10 years ago
How does it compare to normal &quot;Gettext workflow&quot;?<p>Currently I use i18next with custom functions, where I just write strings like _(&quot;car&quot;), ngettext(&quot;window&quot;, &quot;windows&quot;, number) in files. I Can use translator comments, context and everything. (Like &#x2F;&#x2F;TRANSLATORS: this is used in this way etc.) <a href="https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html" rel="nofollow">https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;gettext&#x2F;manual&#x2F;html_node&#x2F;PO-Fil...</a> Babel extracts all translatable strings to POT file. I Translate POT file to my wanted languages PO files with GUI tool of my choice. Then PO file is converted to json and used in translations with i18next library. When New translations are added I just rerun Babel new translations are added, are retranslated if needed and converted to JSON. I looked into a lot of JS libraries and extractors and these was the only one that supported Plurals, context, translator comments, etc.<p>I looked into Mozilla&#x27;s L20 which seems nice. But there is no GUI translation editor. You have to find all translatable strings yourself etc. End it seems it&#x27;s the same here.<p>One better things is that with FormatJS I wouldn&#x27;t need moment.js for date localization.
评论 #8455691 未加载
gear54rusover 10 years ago
A related thought: I wonder if we will some day live in a world where translation is not required. Where everyone knows English and has no trouble using English tools and consuming English content.<p>Same goes for measurement systems (metric), time, currency, and other formats. I reckon it would simplify our lives greatly and spare us the trouble of dealing with 1000s of encodings, multi-byte strings and different text directions.<p>Technological landscape is the only place where such unity between nations is possible, I tend to think that this is what should be pursued instead of translate-everything-everywhere approach.
评论 #8457876 未加载
caridyover 10 years ago
The official announcement is now live:<p><a href="http://yahooeng.tumblr.com/post/100006468771/announcing-format-js-internationalize-your-web-apps-on" rel="nofollow">http:&#x2F;&#x2F;yahooeng.tumblr.com&#x2F;post&#x2F;100006468771&#x2F;announcing-form...</a><p>hopefully it will help to clarify few of the questions...
评论 #8457322 未加载
alexchamberlainover 10 years ago
&gt; 10&#x2F;14&#x2F;2014 English (US) &gt; 14&#x2F;10&#x2F;2014 French<p>Pedantic Englishman here: 14&#x2F;10&#x2F;2014 is used all over Europe, including England. If only we could persuade the world to use an international format: 2014-10-14, for example.
评论 #8457086 未加载
nawitusover 10 years ago
I&#x27;m currently using Moment.js, i18next and Numeral.js with AngularJS. I wonder how FormatJS compares with this. At least one benefit FormatJS could have is having a unified collection of translation files.
评论 #8454110 未加载
macca321over 10 years ago
I would be interested to know if it offers anything over Globalize<p><a href="https://github.com/jquery/globalize" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jquery&#x2F;globalize</a>
评论 #8454138 未加载
mrmchover 10 years ago
Super shameless plug, but easy internationalization for email is something we&#x27;ve added to Sendwithus. We&#x27;re working with multiple partners on it (sample at <a href="https://www.sendwithus.com/translations" rel="nofollow">https:&#x2F;&#x2F;www.sendwithus.com&#x2F;translations</a>), but are still looking for more beta users of the feature.
grakicover 10 years ago
This may be offtopic, but is there an editor for translating ICU messageformat strings?<p>There are many tools to extract gettext strings from source and editors to translate PO catalogs, but I do not know of any that works with ICU messageformat syntax.
joshdanceover 10 years ago
Looks great. One thing that wasn&#x27;t clear, can you provide your own translations or is it all machine translation?
评论 #8454072 未加载
评论 #8455174 未加载
评论 #8454070 未加载