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

Internationalization issues #21

Open
meskobalazs opened this issue Aug 26, 2022 · 3 comments
Open

Internationalization issues #21

meskobalazs opened this issue Aug 26, 2022 · 3 comments
Labels
question Further information is requested
Projects
Milestone

Comments

@meskobalazs
Copy link

meskobalazs commented Aug 26, 2022

These two strings are not great to translate:

jslirola-login2seeplus.forum.post:

newContent += '<div class="jslirolaLogin2seeplusAlert">' + app.translator.trans('jslirola-login2seeplus.forum.post',

jslirola-login2seeplus.forum.post_login:

$newHTML .= '<div class="jslirolaLogin2seeplusAlert">' . $this->translator->trans($key,$args) . '</div>';

In some languages (e.g. in Hungarian in my case) we would like to use conjugation/declension with the Log in and Register string, but currently this is not possible.

@jslirola
Copy link
Owner

jslirola commented Apr 4, 2023

@meskobalazs

Do you have an example of this in another extension to take a look? I'm not sure how to do it yet but I will try to help you.

Have you tried using your own translation with the 'FoF Linguist' extension?

@jslirola jslirola added the question Further information is requested label Apr 4, 2023
@meskobalazs
Copy link
Author

meskobalazs commented Apr 5, 2023

In hindsight I should have been more specific. My issue is that the code is reusing strings it should. In this case:

newContent += '<div class="jslirolaLogin2seeplusAlert">' + app.translator.trans('jslirola-login2seeplus.forum.post',
{
    login: "<a class='jslirolaLogin2seeplusLogin'>" + app.translator.trans('core.forum.header.log_in_link') + "</a>",
    register: "<a class='jslirolaLogin2seeplusRegister'>" + app.translator.trans('core.forum.header.sign_up_link') + "</a>"
}).join('') + '</div>';

core.forum.header.log_in_link and core.forum.header.sign_up_link comes from core, and it works fine in English, because it has the same form as a label and in sentence, but this is not universal. The other string is also similar.

I think that the best course of action would be spelling out the whole string, and not try to optimize it, so jslirola-login2seeplus.forum.post should not contain variables. I get that it causes redundancy, but it makes the life of translators easier, piecemeal strings are usually a bad idea.

By the way I fixed my issue with a workaround, so it's not like I am unable to translate the extension, it just would be better if I did not have to do this.

PS: If you are still unsure what I mean, I can send you a PR.

@jslirola
Copy link
Owner

jslirola commented Apr 5, 2023

Thank you for such detailed information.

If you don't mind, create a Draft PR and I will take a look. Also you could include a new .yaml file with your language to contain the best translation considering you are native (I guess).

Next week I'll try to complete this issue to include a new string so we can work together on the same PR to fix both at the same time:

#23

@jslirola jslirola added this to To do in Login2see+ Apr 5, 2023
@jslirola jslirola added this to the v0.2.2 milestone Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Login2see+
  
To do
Development

No branches or pull requests

2 participants