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

pt_BR override translation not working #982

Closed
3 tasks done
sol2070 opened this issue Jan 18, 2024 · 4 comments · Fixed by #983
Closed
3 tasks done

pt_BR override translation not working #982

sol2070 opened this issue Jan 18, 2024 · 4 comments · Fixed by #983

Comments

@sol2070
Copy link

sol2070 commented Jan 18, 2024

Checklist

  • I am running the latest version. Installing Isso from GitHub from the master branch does not fix my issue
  • I have checked the troubleshooting guide
  • I have searched the open issues, but my issue has not already been reported

What is not working?

Overriding translation string for pt_BR (brazilian portuguese) is ignored. This is specific to this language. When I change to en, it works.

How can one reproduce this issue?

It didn't work from the beginning, in an Ubuntu Server 20.04, Python 3.8.10, pip 20.0.2.

My script tag:

<script
  data-isso="https://isso.sol2070.in/"
  src="https://isso.sol2070.in/js/embed.min.js"
  data-isso-lang="pt_BR"
  data-isso-reply-notifications-default-enabled="true"
  data-isso-page-author-hashes="(redacted)"
  data-isso-postbox-text-text-pt_BR="Digite seu comentário. Markdown OK."
></script>
ix5 added a commit to ix5/isso that referenced this issue Jan 19, 2024
Differing internal representations of two-level language
codes, e.g. pt_BR/pt_PT or zh_CN/zh_TW, would lead to
inconsistencies when combined with overrides of i18n strings
for templating.

E.g. setting data-isso-lang=pt_BR and
data-isso-postbox-text-text-PT_BR would result in an
internal representation of data-isso-postbox-text-text-pt-br
(note: lowercase) and thus user-supplied i18n strings not
being applied.

To make this handling more robust, convert everything into
lowercase and substitute underscores for dashes.

Fixes isso-comments#982
@ix5
Copy link
Member

ix5 commented Jan 19, 2024

@sol2070 please give #983 a try

@sol2070
Copy link
Author

sol2070 commented Jan 21, 2024

Thank you @ix5 ! Sorry, for some reason I did not receive the notification of the reply. Only saw now.
I'm not sure how I can try these changes on my installation. Copying config.js and i18n.js?

@ix5
Copy link
Member

ix5 commented Jan 22, 2024

Thank you @ix5 ! Sorry, for some reason I did not receive the notification of the reply. Only saw now. I'm not sure how I can try these changes on my installation. Copying config.js and i18n.js?

The docs should help you here: Install Isso from source

In short, for only testing the updated Javascript file: make init and then make js, then drop the generated embed.min.js somewhere on your server or web directory/static files dir, then use that as the <script src="/static/embed.min.js"> instead of pointing to src="https://isso.sol2070.in/js/embed.min.js

You can also grab the updated embed.min.js from the CI run https://github.com/posativ/isso/actions/runs/7587591176 (direct link: https://github.com/posativ/isso/actions/runs/7587591176/artifacts/1181755181 )

@sol2070
Copy link
Author

sol2070 commented Jan 22, 2024

@ix5 OK, tested. Now it works fine. Thank you!

@sol2070 sol2070 closed this as completed Jan 22, 2024
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

Successfully merging a pull request may close this issue.

2 participants