Skip to content
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

Translating strings from within the theme and js files #1942

Closed
LukasHirt opened this issue Sep 9, 2019 · 6 comments
Closed

Translating strings from within the theme and js files #1942

LukasHirt opened this issue Sep 9, 2019 · 6 comments
Labels
Category:Enhancement Add new functionality
Milestone

Comments

@LukasHirt
Copy link
Contributor

Description

We have already few strings inside of theme and we are not translating them at all. We need to find a way how to translate them. Not sure if gettext is capable of extracting it. Needs some digging.

@LukasHirt LukasHirt added the Category:Enhancement Add new functionality label Sep 9, 2019
@PVince81 PVince81 added this to the backlog milestone Sep 24, 2019
@LukasHirt
Copy link
Contributor Author

Seems that we can now at least translate js files directly - Polyconseil/vue-gettext#113

@LukasHirt LukasHirt changed the title Translating strings from within the theme Translating strings from within the theme and js files Aug 21, 2020
@kulmann
Copy link
Member

kulmann commented Aug 21, 2020

Trying to use this new feature, I get this error on yarn build:

6: import { translate } from 'vue-gettext'
            ^
7: const { gettext: $gettext } = translate
Error: 'translate' is not exported by node_modules/vue-gettext/dist/vue-gettext.js, imported by ui/store/index.js

(note: not inside phoenix, but in the ocis-accounts ui)

@pascalwengerter
Copy link
Contributor

What's tbd to fix this issue?

@LukasHirt
Copy link
Contributor Author

We're already capable of importing gettext into js files

import { $gettext, $gettextInterpolate } from '../gettext'
What we need now is to actually make the locale reactive for plain js files - atm it won't respect changes in selected language until a refresh

@dschmidt
Copy link
Member

dschmidt commented Dec 8, 2022

Is this issue still relevant?

We have translations in js, ts and vue files (also with lang=ts).

I guess if some translation is not reactive is because it is not wrapped in a computed, otherwise it should be afaik.

What are the acceptance criteria of this ticket?
I'd argue any occurence is an individual bug and should be tracked/fixed as such. I don't see any value in this ticket (anymore)

@AlexAndBear
Copy link
Contributor

as @dschmidt mentioned, translations should work, if on some occurences is not, please open dedicated issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:Enhancement Add new functionality
Projects
None yet
Development

No branches or pull requests

6 participants