JavaScript(ECMAScript)の国際化API、「Intl」について紹介する1人 Advent Calendar です。 2024末時点でのIntl仕様と提案されているProposalを広く紹介することをゴールとしています。合わせてIntlに関連する仕様についても端端で紹介できたらなと思っています。 機能・ドメイン的に関連する話題をまとめて紹介していくので、「既存仕様→関連するProposal」の順で繰り返す流れになる予定です。基本的な機能だけ知りたいよと言う方は適宜読み飛ばしてください。
Internationalization is the design and development of a product, application or document content that enables easy localization for target audiences that vary in culture, region, or language. --- W3C Web Internationalization FAQ Lingui is an easy yet powerful internationalization (i18n) framework for global projects. Clean and readable - Keep your code clean and readable, while the library uses ba
Stéphane Goetz (@onigoetz) is a performance enthusiast. Working on developer tooling, frontend libraries, and architecture as Principal Software Engineer at Swissquote Bank. Introduction I wish to bring you with me on a journey to learn about optimizing a library for localization, I would like to share my learnings with you on benchmarking, profiling, and optimizing. At Swissquote Bank, we use cli
This post is part of my Byte Series, where I document tips, tricks, and tools that I've found useful. ProblemWhen building a localized JavaScript web-app, the default sorting logic for strings doesn't quite yield the results that you might expect. For example, take the following example… let strings = [ "nop", "NOP", "ñop", "abc", "abc", "äbc" ]; strings.sort(); console.log(strings); // ['NOP', 'a
Listify a JavaScript ArrayFebruary 18th, 2021 — 6 min read When you want to display a list of items to a user, I'm afraid .join(', ') just won't cut it: console.log(['apple'].join(', ')) // apple // looks good console.log(['apple', 'grape'].join(', ')) // apple, grape // nah, I want "apple and grape" console.log(['apple', 'grape', 'pear'].join(', ')) // apple, grape, pear // wut? Ok, so bust out y
Asymmetric Localization Natural-sounding translations with genders and grammatical cases only when necessary. Expressiveness is not limited by the grammar of the source language. Progressive Enhancement Translations are isolated; locale-specific logic doesn't leak to other locales. Authors can iteratively improve translations without impact on other languages. Fully-Featured Date, time, and number
Number#toFixed や Math.round/floor/ceil を駆使して表示用の値を整形することってないでしょうか。カンマ区切りをオレオレユーティリティ関数で実装したりそういったことを実現するライブラリを探したことはないでしょうか。 ほとんどの JavaScript の実行環境にはIntlという i18n のためのオブジェクトが組み込まれており、その中の1つにIntl.NumberFormatというクラスがあります。 オプションが色々あり、かなり便利で多機能なんですが整理された情報が少なく、身の回りで使用してる人も少ないと感じました。 Do you use Intl.NumberFormat? — れこ (@L_e_k_o) February 25, 2019 (2019/03/04あたりに結果表示されると思います。途中経過を見る場合元ツイートに飛んでください。) 「それ自
Iñtërnâtiônàlizætiøn is hard. Handling plurals is one of many problems that might seem simple, until you realize every language has its own pluralization rules. For English pluralization, there are only two possible outcomes. Let’s use the word “cat” as an example: 1 cat, i.e. the 'one' form, known as the singular in English2 cats, but also 42 cats, 0.5 cats, etc., i.e. the 'other' form (the only
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く