-
Notifications
You must be signed in to change notification settings - Fork 1.1k
$translate.use() is not switching languages #1800
Comments
Hello, as we had already mentioned in the issue's template, we need a working and as minimal as possible demo covering your specific use case or issue. Follow these steps:
|
@SimonSimCity Thanks for replying, but unfortunately no. If your investigation holds true, our app can be running also in race condition because we didn't set fallback language on purpose. We intended to load the language right after our app starts. There could be a conflicts between whether to load language pack or not. I am hoping that the solution can be more universal. I am working on the plunker and see if I can reproduce my bug. Mean a while, we are using 2.13.1 which seems to be running ok. |
Hello, I have similar issue with $translate.use(). Steps to reproduce: Loading c1 $translate.refresh() loads en-c1.json but unlike $translate.use() this will keep loading promise in memory. This mean when we are in c2 and try to load en-c2.json, $translate.use() thinks that loading en-**.json is still in progress and returns old promise. $translate.use() uses function clearNextLangAndPromise(key) to clear unnecessary promises on promise.finally(). This function should be used in other translations loading functions. Enviroment:
|
config:
run:
rootController (
route as parent of all other route:
open url: Console:
First it doesn't change to FA, secondly even though it said it change to fa, it still returns english language data :| |
Subject of the issue
Upon setting fallback language, switching language with $translate.use('de')/$translate.use('en') is successful in original state but not successful after state change
Environment
Steps to reproduce
Have 2 states, and 2 language packages. One partial language component for each state.
Expected behaviour
Language should switch between en or de
(version 2.13.1 or lower does the trick)
Actual behaviour
The display language is stuck with en(or the fallback). If no fallback languages are given, it renders the keys.
The text was updated successfully, but these errors were encountered: