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

Translations not working properly #9

Closed
lucasromanojf opened this issue Aug 23, 2018 · 12 comments
Closed

Translations not working properly #9

lucasromanojf opened this issue Aug 23, 2018 · 12 comments

Comments

@lucasromanojf
Copy link

The translations (using the json file) are only working on the login screen. They are not working inside resource's index for example.

Also, some texts are not possible to translate. Some examples are the "Search" text (inside search fields), the "TRASHED:" text (inside index filters) and "No {resource} matched the given criteria." (grids) that are hardcoded.

@gdespirito
Copy link

+1

@gdespirito
Copy link

I fixed it changing the route where the app is looking for the translations on Nova. I think it would be an easy fix.

@themsaid
Copy link
Member

make sure you're running latest Nova.

@lucasromanojf
Copy link
Author

I'm running 1.0.5. Translations json is working now, but there are still hardcoded texts.

image

image

image

@BlazL
Copy link

BlazL commented Sep 1, 2018

+1
I'm running 1.0.8.

@ghost
Copy link

ghost commented Sep 6, 2018

+1
I'm running 1.0.12

@themsaid
Copy link
Member

themsaid commented Sep 6, 2018

Can anyone share what the issue is? Translations are working fine for me and I can't replicate the issue, if someone can share more information that'd be great.

@themsaid themsaid reopened this Sep 6, 2018
@ghost
Copy link

ghost commented Sep 6, 2018

Hello @themsaid,

open resources/views/Index.vue line 226:

                    `No {{resourceInformation.label.toLowerCase()}} matched the given criteria.`

The string is hardcoded and I can't translated it by editing en.json or <language_code>.json

Same thing for GlobalSearch and Search components: placeholders strings are hardcoded.

Try to create a new language file and edit "Search" and "No :resource matched the given criteria." tokens. Refresh the page and you will see strings remain untranslated.

@bonzai
Copy link

bonzai commented Sep 6, 2018

Translations are (almost) working, except there are a lot of hardcoded strings inside Vue components:

Also some functions stops working if the current language is not English:

@themsaid
Copy link
Member

themsaid commented Sep 6, 2018

#219 wow, thanks for pointing this out.

@themsaid
Copy link
Member

themsaid commented Sep 6, 2018

Thanks @antoniolore and @bonzai. I'm working on it.

@gvsrepins
Copy link

gvsrepins commented Jan 2, 2019

Hello @themsaid! Thank you for the support.

To help on this matter.. I was only able to translate a BelongsTo field, making an overwrite of the indexName value. I think that this was not the intented Behavior since it's not documented.

Se code bellow to clarify:

BelongsTo::make('Activity')
                    ->singularLabel(__('Activity'))
                    ->nullable()
                    ->searchable()
                    ->withMeta(['indexName' => __('Activity')]),

PS: Only tested with BelongsTo, but it probably should happens with others realtionship fields to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants