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

[Bug]: i18n: Variables do not work for e. g. Hungarian #7962

Open
4 tasks done
rakekniven opened this issue Mar 4, 2025 · 4 comments
Open
4 tasks done

[Bug]: i18n: Variables do not work for e. g. Hungarian #7962

rakekniven opened this issue Mar 4, 2025 · 4 comments

Comments

@rakekniven
Copy link
Member

rakekniven commented Mar 4, 2025

⚠️ Before submitting, please verify the following: ⚠️

Bug description

const auto itemTypeName = (isDirectory ? tr("Folder", "name of folder entity to use when warning about invalid name") : tr("File", "name of folder entity to use when warning about invalid name"));
if (invalid) {
item->_errorString = tr("%1 name containing the character \"%2\" is not supported on this file system.", "folder or file impossible to sync due to an invalid name, placeholders will be file or folder and the invalid character").arg(itemTypeName, QChar(invalid));
} else if (isInvalidPattern) {
item->_errorString = tr("%1 name contains at least one invalid character").arg(itemTypeName);
} else {
item->_errorString = tr("%1 name is a reserved name on this file system.").arg(itemTypeName);

"The issue is with %1, this can be either File or Folder. These are at the start of the sentence in English, but e.g. in my language they will be in the middle of the sentence, so I shouldn't capitalize them. I am lucky as this is the case in all three strings, but if it wasn't, I couldn't translate it properly. I am not sure that this could be solved easily in all languages.

More generally, these kind of clever optimizations are not a great idea, and they save very little work for most people (now we have 5 strings instead of 6), while causing issues to others."

Solution would be to have 3 strings for "File" and 3 strings for "Folder".

@Rello
Copy link
Contributor

Rello commented Mar 4, 2025

Hi,

so your suggestion is to get rid of %1 and hardcode the strings with e.g.

  • "File name contains at least one invalid character"
  • "Folder name contains at least one invalid character"

for understanding, what would be the different translation in HU e.g.?

@rakekniven
Copy link
Member Author

The case.

"The issue is with %1, this can be either File or Folder. These are at the start of the sentence in English, but e.g. in my language they will be in the middle of the sentence, so I shouldn't capitalize them. I am lucky as this is the case in all three strings, but if it wasn't, I couldn't translate it properly. I am not sure that this could be solved easily in all languages."

@Rello
Copy link
Contributor

Rello commented Mar 4, 2025

ah, wait.
you mean "Folder" is a separate string that is translated on its own.
if now - not in this case, but another case - the sentence would be "bla bla bla %1 bla bla bla", then it would replace the capital "Folder" in the middle of the sentence.
Did I get it correctly?

@rakekniven
Copy link
Member Author

Did I get it correctly?

Yes. This is how I understood it from the hungarian translator who reported this issue.

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

No branches or pull requests

3 participants