The pages/404.tsx page allows to customise the 404 error displayed to the end user. See https://nextjs.org/docs/advanced-features/custom-error-page#404-page But, since it lives in /pages and not /pages/[locale] as do my other Pages, it doesn't benefit from i18n support. I have successfully displayed the 404 page, but it's the same for all languages (no i18n support). I tried to use getStaticPaths,
Tempo is a new library in a proud tradition of JavaScript date and time libraries. Inspired by the likes of moment.js, day.js, and date-fns, Tempo is built from the ground up to be as small and easy to use as possible (all features ~5kB compressed) — including first-class support for timezone operations. Tempo is best thought of as a collection of utilities for working with the native Date object
Intl.Segmenter についておさらい JavaScript には Intl と呼ばれる国際化 API があり、日時や数値のフォーマットを始めとする国際化に便利な機能が揃っています。Intl.Segmenter はこの Intl の一機能で、文字・単語・文章単位での文字列分割を可能にします。 文字単位での分割では複数のコードユニットやコードポイントを持った文字を考慮し、正確に見た目上の1文字(書記素)で分割できるので、絵文字を含んだ文字数のカウントなどに便利です。 const segmenter = new Intl.Segmenter("ja", { granularity: "grapheme" }); console.log("🇯🇵👨🏻💻".length); // ❌ 11 console.log([..."🇯🇵👨🏻💻"].length); // ❌
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 client-composed micro-frontends, and our platforms are usually available in at least 8 languages. To support this requirement, we had to build a translation/localization library
こんにちは、SmartHR でプロダクトエンジニアをしている @nabeliwo です。 今年の9月に SmartHR のログイン後のホーム画面がリニューアルされました。 【9/21更新】新しいホーム画面を公開しました | SmartHR|シェアNo.1のクラウド人事労務ソフト この記事では、新しいホーム画面の実装の中で、開発者体験を損なうことなく多言語化対応を進められるよう、TypeScript の型定義を工夫した話をします。 まだまだ改善の余地がある状態ではあるのですが、私達のチームでの試行錯誤が読んでくれた方の参考になれば幸いです。 SmartHR の多言語化対応 SmartHR の既存のページではすでに WOVN.io というツールを使った多言語化対応が行われていました。 ただ諸々の理由があり1、新しいプロダクトでは自前で翻訳の仕組みを用意していこうとしています。 実際に、Smar
2022年12月1日、Discordはカスタマイズされたオリジナルのフォント「gg sans」を導入しました。ggは"Good Game"に由来するようです。Web フォントなどを利用して Discord 上の表示がこのフォントに順次切り替わる予定です。 補足 / UPDATE 2022/12/03 14:37 JST DiscordのCEO(Jason氏)より返事があり、ツとノの字形がgg sansから削除されたとのことです。右括弧は現時点で残っているようです(これは当初のわたしの指摘がツとノのみに限られていたせいです)。 2022/12/04 14:55 JST 12/3時点でJason氏からの返信に右括弧が残っているという旨を補足しました。 12/4 午前にDiscordのエンジニア Brandon氏より連絡があり、括弧等の修正が完了したとのことです。 こちらで確認する限り、CJK関
tl;dr ブラウザで文字列を表示する場合画面幅に応じて自動で改行されることがあります。英文などは分かち書きされているためブラウザは単語の区切りなどで改行することができますが、和文は文節が明確ではなく単語の途中で改行されてしまうことがあります。 この記事では、ECMA402 の Intl.Segmenter を用いて和文を分かち書きし、ブラウザに改行可能箇所を教えることでより読みやすいレイアウトを目指します。 (2023/04/14 追記) NPM package として公開しました 🚀 背景 ラテン文字を使用する多くの言語では語と語が空白で区切られていますが(以降分かち書き)、通常、日本語や中国語は分かち書きされていません。 一般的なブラウザでは表示領域(横幅)に対して表示させたい文字列が一行に収まらない場合自動で改行するような挙動になっています。英語のように既に分かち書きされた文の場
News, announcements, release info, and calendar updates from the Unicode Consortium I. IntroductionHello! Ndeewo! Molweni! Салам! Across the world, people are coming online with smartphones, smart watches, and other small, low-resource devices. The technology industry needs an internationalization solution for these environments that scales to dozens of programming languages and thousands of human
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
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く