-
-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
te
returns invalid value when the given value (or "branch") is an object
#1738
Comments
te
breaks when translations are loaded via packagete
returns invalid value when the given value of the "branch" is an object
te
returns invalid value when the given value of the "branch" is an objectte
returns invalid value when the given value (or "branch") is an object
Reading more about this, I've found that this works:
But, maybe that is not the nicest solution, because it adds a lot more operations than it previously was |
@kazupon It seems very related to #1602 I've added a very simple Stackblitz reproduction: https://stackblitz.com/edit/vitejs-vite-gyzvu8?file=src%2FApp.vue |
Thank you for your reporting!
This is the result of your reproduction above, which is the correct behavior. I will put this notice in Thanks! |
Hi @kazupon is there an alternative? Or can one be provided? Because our applications rely on this check and therefore are now broken on this version. |
@sybrendotinga We will remove that option in the next major version v10, so please migrate at some point. |
That would be great, thank you. Nonetheless, we would still appreciate an alternative after that. Can
|
vue-i18n v9 is giving us Like the code you presented, we can check if there is a branch by using |
Reporting a bug?
After upgrading to v9.6 we are experiencing that the
te
does not recognize changes anymore.Expected behavior
After
mergeLocaleMessages
is called we expectte
to returntrue
, because the message now existsReproduction
mergeLocaleMessages
te('common')
should now betrue
In this example you can see that the "Terug"-translation is loaded, via the external package.
The first
true
is thete('common.action.cancel.label')
from the portal, the second false-valuete('common')
.Stackblitz: https://stackblitz.com/edit/vitejs-vite-gyzvu8?file=package.json
When downgrading to ~9.5 all values are
true
.System Info
Screenshot
Additional context
Because we have a lot of translations, we load them from the API, based on a given
prefix
. For example "load all translations for the employee-prefix"We use the following setup:
pnpm
) that loads translations based on aprefix
. e.g.entity.employee
mergeLocaleMessage
to merge the new translations into the existing translations:The private library aswel as
vue-i18n
is installed in the project.I discovered that it returns
false
becausete('common')
is not very specific to a translation, but to a branch of translations.Validations
The text was updated successfully, but these errors were encountered: