i18n

VeeValidate メモ

Vue のバリデーションライブラリ VeeValidate の使い方をまとめたもの。(VeeValidate 2.1.0-beta.11, Vue 2.5.17) 基本的な使い方 バリデーションルールのシンタックス カスタムルール さらに詳しく エラーメッセージ エラーメッセージを変更/追加する 入力…

9月メモ・リンク集

9月に調べたことのメモです。 Vue 関連 ルーティング関連 i18n 言語データの整理方法メモ その他 Vue 関連 What is the best way to access this.$router.push() / router.push() inside the Vuex? · Issue #1384 · nuxt/nuxt.js · GitHub v-on to bind dom …

5月メモ・リンク集

5 月に調べたことのメモです。 Angular 関連 third party lib Testing in ngrx Version 6 Rx 関連 catchError Rails 関連 その他 Angular 関連 third party lib stories global scripts · angular/angular-cli Wiki · GitHub 例えばグローバルに jQuery を i…

Angular (4)で設定したLocale IDを取得

LOCALE_IDを利用。 以下のようにAOTでコンパイルしていない場合、初期値のen-USになります。 ng serve --aot --locale ja import { Component, OnInit, LOCALE_ID, Injector } from '@angular/core'; export class FooComponent implements OnInit { constru…

AngularのDatePipeのlocaleを変更したい場合(タイムゾーンを変更したい場合、も)

(Angular v.4.3.6を利用) 起動時にlocaleを設定 (JIT) 動的にlocaleを変更 タイムゾーンを変更 参考Url 起動時にlocaleを設定 (JIT) LOCALE_IDを設定 DatePipe error when using `navigator.language` as LOCALE_ID with aot · Issue #6618 · angular/angu…

Angularでi18n

(Angular v.4.3.6を利用) 準備 翻訳対象(HTMLのタグ)にi18n属性を設定 要素を追加しない方法 属性値を翻訳 複数形、代替テキスト ファイル(XLIFF)の書き出し XLIFFファイルについて Serve Build Report missing translations 参考 Angular CLI環境でアプ…

通貨記号つきで金額を表示

便利。(最近まで知らなかった) IEは11以上なら大丈夫。 console.log(number.toLocaleString('ja-JP', { style: 'currency', currency: 'JPY' })) // → ¥123,457 console.log(new Intl.NumberFormat('ja-JP', { style: 'currency', currency: 'JPY' }).for…