私はこれを使用しています: https://github.com/archer96/ng-i18next
オプションでのみ言語を取得できます(設定されている場合):
console.log("language: " + $i18next.options.lng);
現在の言語をどのように取得しますか? ドキュメントには次のように書かれています: i18n.lng() は現在の lng を返します。
しかし、angular $i18next.lng() のコンテキスト内では存在しません。
私も試しました:
console.log("language: " + $i18next.lang);
console.log("language: " + $i18next.language );
console.log("language: " + $i18next.lng);