時刻表示や件名などにはコロンを含むことがよくある。
そのようなテキストをi18nextで変換した際、トラブって発狂する。
下記のサンプルソースだと本来は”午前9:00 – 10:00″と表示される事を夢みている。
が、現実は甘くない。
この問題の理由はi18nextがコロンやピリオドをキーワードとして扱っているため。
このような場合、i18nextの初期化のタイミングで名前空間セパレータ、キーセパレータとしている文字を変更する事で対応できる。
i18next.init({ keySeparator: '>', nsSeparator: '|' });
見事、目的の文字を得ることができた。
ググっても以外と出てこず、Issue投げようとして出てきたヒントの中に同様のIssueがあり気づけた。
その他i18nextオプション
https://www.i18next.com/overview/configuration-options
Deprecated: Function get_magic_quotes_gpc() is deprecated in /virtual/rizworks/public_html/mashpote.net/wp-includes/formatting.php on line 4803
Deprecated: Function get_magic_quotes_gpc() is deprecated in /virtual/rizworks/public_html/mashpote.net/wp-includes/formatting.php on line 4803
Deprecated: Function get_magic_quotes_gpc() is deprecated in /virtual/rizworks/public_html/mashpote.net/wp-includes/formatting.php on line 4803