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

Error when using a language other than English, for example nl_BE, pt_BR among others. #93

Closed
gustotc opened this issue Dec 8, 2020 · 25 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@gustotc
Copy link

gustotc commented Dec 8, 2020

following image below the JS error
Updated version
Odoo version 12.0
formio_translations_pt_BR.xml.zip

image

@bobslee bobslee added the bug Something isn't working label Dec 8, 2020
@bobslee
Copy link
Member

bobslee commented Dec 8, 2020

@gustotc Thanks for your issue report.
Few days ago I pushed a change for version 12.0 and 13.0 which addresses similar issue: 6e192fc

You already updated to the latest version 12.0 or 13.0 of the formio module?
Keep me posted please.

@gustotc
Copy link
Author

gustotc commented Dec 9, 2020

@bobslee, thanks for the feedback,

Yes, I updated it yesterday.

Before the update he always assumed the language "EN" then the fields in English worked, but after its correction and takes the correct language, however it gives the error in the JS of the image.

It gives error in JS and does not mount any field, if I leave it in 'EN' the language assembles the screen.

@bobslee
Copy link
Member

bobslee commented Dec 9, 2020

@gustotc, thanks for your reply.
I can reproduce a similar error. Shall fix this soon. Keep you posted!

@bobslee bobslee added this to the Milestone 1 milestone Dec 9, 2020
@bobslee bobslee self-assigned this Dec 9, 2020
@bobslee
Copy link
Member

bobslee commented Dec 9, 2020

@gustotc I think I solved this implementation. Shall push very soon (within hours).

@gustotc
Copy link
Author

gustotc commented Dec 9, 2020

@bobslee

Thanks for listening ...

@bobslee
Copy link
Member

bobslee commented Dec 9, 2020

@gustotc Please download and replace formio with version 8.1
Should be fixed now.
Let me know or close the issue :)

@bobslee
Copy link
Member

bobslee commented Dec 9, 2020

@gustotc by the way... I added your translations into theformio module. Thanks!

@gustotc
Copy link
Author

gustotc commented Dec 9, 2020

@bobslee

Thank you very much

What I can help you can count on me, including the translation of the module to pt_BR, if you want. If so, I'll send you the file.

@gustotc gustotc closed this as completed Dec 9, 2020
@bobslee
Copy link
Member

bobslee commented Dec 9, 2020

@gustotc Yes please send me the translation files.

Would be glad if you could contribute by any means.
Take care!

@gustotc
Copy link
Author

gustotc commented Dec 9, 2020

@bobslee

It follows pt_br translation files by module, already separated by module folder.

Best regards,

translate_pt_BR_per_Module.zip

@gustotc gustotc reopened this Dec 9, 2020
@gustotc
Copy link
Author

gustotc commented Dec 9, 2020

@bobslee

I had to reopen the error, because:
In the Construction of the Form it worked perfectly, however in the visualization in the CRM module it has the error.

image

image

@bobslee
Copy link
Member

bobslee commented Dec 9, 2020

@gustotc Unfortunately I can't reproduce the error.

Please could you provide more info/data?
I would like to test with your Form Builder schema (field data). Could you it share with me?
Of course you can mail the schema (field data) to me: bob (at) novacode (dot) nl

@bobslee
Copy link
Member

bobslee commented Dec 9, 2020

Just found an issue with language switcher and language code. Still working on...

bobslee added a commit that referenced this issue Dec 9, 2020
…orm Builder and Forms.

- Replace iso_code by code (e.g. nl now nl_NL).
- Add field "English Enable" on Form Builder, if English is installed
  this shows the English language button, even if no translations (so
- Formio defaults).

Concerns #91, #93
bobslee added a commit that referenced this issue Dec 9, 2020
…orm Builder and Forms.

- Replace iso_code by code (e.g. nl now nl_NL).
- Add field "English Enable" on Form Builder, if English is installed
  this shows the English language button, even if no translations (so
- Formio defaults).

Concerns #91, #93
bobslee added a commit that referenced this issue Dec 9, 2020
…orm Builder and Forms.

- Replace iso_code by code (e.g. nl now nl_NL).
- Add field "English Enable" on Form Builder, if English is installed
  this shows the English language button, even if no translations (so
- Formio defaults).

Concerns #91, #93
@bobslee
Copy link
Member

bobslee commented Dec 9, 2020

@gustotc Please download and update to version 8.2 (formio).
I resolved and improved some issues with the language switcher (buttons) and also translations should work now.
I tested thoroughly, so I'm curious whether it works with you.

@gustotc
Copy link
Author

gustotc commented Dec 10, 2020

@bobslee

sorry, i just saw your message now.

If you still want I can send the form without any problem, but as you generated a new version I will test it well and return.

Thank you very much for your attention and count on me to test and report and if you allow it, I can also try to identify maybe improvements and post for you to see if it is useful.

Thank you again,

Best Regards

@gustotc
Copy link
Author

gustotc commented Dec 10, 2020

@bobslee

unfortunately the error still occurs. I will try to explain it better.

I'm using your demo model, in the commercial module.

When I edit the form, it works perfectly, but when I enter the commercial module, select a sale and click on the form button to complete it, it does not load the fields and in the browse console shows the image error.

However, if fixed in the language 'EN' it works, load the fields for filling. I also tested by modifying the language to another language "nt_BE" and the error also occurs.

image

image

@niulinlnc
Copy link

niulinlnc commented Dec 10, 2020

@bobslee After version 14 was updated to the latest, there were similar problems. If I set up a non-English environment (such as simplified Chinese) in Odoo and added a translation package (simplified Chinese) to my Builder, I wouldn't be able to pop up a dialog box when the builder builds a field.

@niulinlnc
Copy link

niulinlnc commented Dec 10, 2020

@bobslee Please see the following steps for replicating:
101712440-7e35dd80-3ad0-11eb-9c1e-c774d31d8011

002
003
004

@bobslee
Copy link
Member

bobslee commented Dec 10, 2020

Thanks for reporting. I'll come back to this within a few days (weekend).
I've some clues how to analyse/debug and hopefully solve.

@gustotc
Copy link
Author

gustotc commented Dec 10, 2020

Thanks for reporting. I'll come back to this within a few days (weekend).
I've some clues how to analyse/debug and hopefully solve.

Thank you very much, good weekend, rest to recharge your batteries.

@bobslee
Copy link
Member

bobslee commented Dec 14, 2020

@gustotc I reproduced the issue and finally solved on my local development env.

Issue is due to formatting the language code with an underscore "_", whereas the Formio JS implementation expects a hyphen "-".

Before I push the change, I improve the code and shall test again.

This is also related to #91, #95

bobslee added a commit that referenced this issue Dec 15, 2020
…orm Builder and Forms.

Convert the Odoo language code (underscore "_") to Formio JS/i18n
expected IETF code (hyphen "-").

Concerns #91, #93.
bobslee added a commit that referenced this issue Dec 15, 2020
…orm Builder and Forms.

Convert the Odoo language code (underscore "_") to Formio JS/i18n
expected IETF code (hyphen "-").

Concerns #91, #93.
bobslee added a commit that referenced this issue Dec 15, 2020
…orm Builder and Forms.

Convert the Odoo language code (underscore "_") to Formio JS/i18n
expected IETF code (hyphen "-").

Concerns #91, #93.
bobslee added a commit that referenced this issue Dec 15, 2020
…anslations in Form Builder and Forms).

Concerns #91, #93, #95
bobslee added a commit that referenced this issue Dec 15, 2020
…anslations in Form Builder and Forms).

Concerns #91, #93, #95
bobslee added a commit that referenced this issue Dec 15, 2020
…anslations in Form Builder and Forms).

Concerns #91, #93, #95
@bobslee
Copy link
Member

bobslee commented Dec 15, 2020

@gustotc Issue should be solved now.
Please download and upgrade to formio version 8.3. Clear your webbrowser cache too.
Let me know if any further issues regarding translations and language switcher.

@gustotc
Copy link
Author

gustotc commented Dec 15, 2020

I reproduced the issue and finally solved on my local development env.

Issue is due to formatting the language code with an underscore "_", whereas the Formio JS implementation expects a hyphen "-".

Before I push the change, I improve the code and shall test again.

This is also related to #91, #95

good news

Thank you.

@gustotc
Copy link
Author

gustotc commented Dec 15, 2020

Issue should be solved now.
Please download and upgrade to formio version 8.3. Clear your webbrowser cache too.
Let me know if any further issues regarding translations and language switcher.

Okay, I'll do what you asked for, test it and let you know.

Thank you.

@gustotc gustotc closed this as completed Dec 15, 2020
@bobslee
Copy link
Member

bobslee commented Dec 31, 2020

@bobslee

It follows pt_br translation files by module, already separated by module folder.

Best regards,

translate_pt_BR_per_Module.zip

@gustotc I just added your pt_BR translations to the v12.0 branch.
For later versions, I hope you or somebody could maintain. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants