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

List of wordings that aren't visible in Transifex, so can't be translated #261

Open
Jerome-Herbinet opened this issue Oct 27, 2023 · 20 comments
Assignees

Comments

@Jerome-Herbinet
Copy link
Contributor

Jerome-Herbinet commented Oct 27, 2023

Describe the bug
List of wordings that aren't visible in Transifex, so can't be translated in other languages :

  • Start
  • Open room
  • Clone room
  • unlimited
  • Moderator

Nextcloud BBB App 2.5.0
BBB 2.7.2
Nextcloud Hub 6 - 27.1.2

At your disposal for further information.

@zak39 zak39 self-assigned this Mar 1, 2024
@zak39
Copy link
Collaborator

zak39 commented Mar 1, 2024

These words are missing from the translation files

@sualko
Copy link
Member

sualko commented Jul 2, 2024

@nickvergessen I guess we still have an issue with translations. If I run translationtool.phar create-pot-files those terms above pop up, but they are not available in transifix. Do you know if I have to change anything else, due to moving this repo to another organization? According to https://docs.nextcloud.com/server/stable/developer_manual/basics/front-end/l10n.html#translation there is not much configuration.

@nickvergessen
Copy link

<a href={api.getRoomUrl(room)} className={`button ${room.running ? 'success' : 'primary'}`} target="_blank" rel="noopener noreferrer" title={t('bbb', 'Open room')}>

Hmm TSX files should be found:
https://github.com/nextcloud/docker-ci/blob/master/translations/translationtool/src/translationtool.php#L70

Maybe the ` usage in the line breaks it somehow?
But then why would you see it locally?

@sualko
Copy link
Member

sualko commented Jul 3, 2024

@nickvergessen I checked the pot file again and it seams that the term will only be fined in the compiled js code.

#: /home/klaus/Repos/cloud_bbb/js/manager.js:2
msgid "Open room"
msgstr ""

There are other terms found in the RoomRow.tsx, so I guess it is not a generell error. Can you tell me where I can open an issue for this?

@smarinier
Copy link
Collaborator

Hi @sualko and @nickvergessen, if the automate tool that generate the transifex entries fails somehow, is it possible ti bypass this tool bugs by creating ourselves the entries in the transifex ? Or does the tool erase the entries it did not found (because of its lacks/bugs) ?

@nickvergessen
Copy link

As mentioned above, maybe you can try to break the line:

<a href={api.getRoomUrl(room)} className={`button ${room.running ? 'success' : 'primary'}`} target="_blank" rel="noopener noreferrer" title={t('bbb', 'Open room')}>

Into multiple

<a href={api.getRoomUrl(room)}
className={`button ${room.running ? 'success' : 'primary'}`}
target="_blank"
rel="noopener noreferrer"
title={t('bbb', 'Open room')}>

My assumption is that the ` character in class name is breaking it.

So could also try temporary for a sync of the translations to remove that bit:

<a href={api.getRoomUrl(room)}
target="_blank"
rel="noopener noreferrer"
title={t('bbb', 'Open room')}>

@smarinier
Copy link
Collaborator

Try in PR #283

@smarinier
Copy link
Collaborator

Hi @nickvergessen, the "break of lines" doesn't seem to improve the Transifex parser results. How could we debug this ?

@nickvergessen
Copy link

A quick test locally confirms my suspicion from #261 (comment)

On master there are 18 strings found in ts/Manager/RoomRow.tsx

Deleting line:

						className={`button ${room.running ? 'success' : 'primary'}`}

And running it again finds 23 strings in ts/Manager/RoomRow.tsx

So yeah the ` character is the problem. Can you "inject" the class name ready calculated instead of calculating it here?

@smarinier
Copy link
Collaborator

Wouldn't it be more interesting to fix the bug in translationTool rather than discovering labels are missing from tsx files ?

@nickvergessen
Copy link

the "problem"/"bug" is in the gnu tool gettext not our .phar btw.
I guess it just does not support the JSX/TSX syntax fully.

@smarinier
Copy link
Collaborator

@nickvergessen Indeed, this is a xgettext failure. The first backtick is taken in account, but the ending one is not. If there are t() calls between the first backtick and the third (as it seems to re-parse), then the sentences are lost by translationtool.

Please note that if the translationtool is called AFTER the build-js, then it works for all sentences, as it find them in the TypeScript file converted into classical JS (in js/manager.js). This would be probably the best workaround for the xgettext bug. May these actions be re-ordered ? (@sualko ?)

If not, i've made a PR #284 whose purpose is to avoid all these backticks troubles.

@nickvergessen : i've made some improvements in translation.phar, in order to help detecting these errors.
-> add commands options (-h, -v)
-> some verbose logs
-> add a "check-files" action, that use "extract-all" in order to detect all backticks errors.
Are you interested in such a PR in the translation.phar, or is this tool considered as too important to be changed ?

@nickvergessen
Copy link

Are you interested in such a PR in the translation.phar

Sure go ahead :) Put send them against the php file instead. We will recreate the phar later.

This would be probably the best workaround for the xgettext bug.

We can't do that for apps that send minified js (e.g. all vue apps we maintain) as they end up with garbage strings like a, strong and things a like from various HTML attributes.

@smarinier
Copy link
Collaborator

smarinier commented Aug 17, 2024

Hi,
The PR with backticks fixes was merged yesterday. Could you tell how and when does it may impact Transifex content ?

@nickvergessen
Copy link

It updates every night between 3 and 6am CE(S)T.
So it should have uploaded the new strings this morning and would download translated strings tomorrow when someone translated them

@smarinier
Copy link
Collaborator

There might be a trouble. Transifex tell me 138 sentences for "bbb" application. The .pot construction with translationtool gives about 160 msgid. And of course, the new sentences theorically accessible trough the backticks removal are not found.

@smarinier
Copy link
Collaborator

Hi @sualko and @nickvergessen. So i've modified translationtool so that i can check all the missing sentences, changed all the backticks sentences accordingly, commited them, but nothing happen in Transifex. I don't think i can access to any logs to the actions linked to the translationtool and transifex, but it seems sticked here. Would you have a look on it please ?

@nickvergessen
Copy link

I'm on vacation starting tomorrow. We can try to have a look during the contributor week either together or I do it alone then

@smarinier
Copy link
Collaborator

I'll be back from Berlin conference on 16th. I will be pleased to have a look from the 17th with you.

@smarinier
Copy link
Collaborator

@nickvergessen @sualko : i've just seen that the words have been integrated recently in the Transifex. (includes also the new sentences from the PR #281 ). Don't know if someone did something special, but maybe this ticket can be closed ?

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

5 participants