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

Semicolons in locale_en-US.ini #23814

Closed
kzmi opened this issue Mar 30, 2023 · 4 comments · Fixed by #23819
Closed

Semicolons in locale_en-US.ini #23814

kzmi opened this issue Mar 30, 2023 · 4 comments · Fixed by #23819

Comments

@kzmi
Copy link
Contributor

kzmi commented Mar 30, 2023

Description

There is an issue with the locale_en-US.ini file where the following four keys contain semicolons:

  • settings.protect_protected_file_patterns
  • settings.protect_protected_file_patterns_desc
  • settings.protect_unprotected_file_patterns
  • settings.protect_unprotected_file_patterns_desc

The semicolons are causing problems because Crowdin treats a semicolon as the beginning of a comment:

image

This leads to the following issues:

  • The part of the text after the semicolon cannot be translated.
  • Crowdin appends the original comment to the end of the translation. (see locale_zh-CN.ini)

It may be possible to enclose the text in double quotes to prevent Crowdin from treating the semicolon as a comment.

Gitea Version

265675a

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Database

None

@kzmi kzmi added the type/bug label Mar 30, 2023
@lunny lunny added this to the 1.19.1 milestone Mar 30, 2023
@lunny
Copy link
Member

lunny commented Mar 30, 2023

I think most of the translations have the same problems. Maybe we need some translations lint when pushing.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 30, 2023

I have removed most semicolons in en-US.ini. Those are the last four. Luckily, these four doesn't break the translations too much, it only causes that part of the sentence doesn't get translated.

This time I will do a quick patch , try to use \; as before, or try to see if " works for both (crowdin & Gitea)

Next time I will propose a complete PR.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 30, 2023

lunny pushed a commit that referenced this issue Mar 31, 2023
…x some strings with semicolons (#23819)

Follow #23633 and #23240

Close #23814

Now we almost have a complete test set for Gitea's LocalStore.

This PR is still a quick fix for the legacy locale system (see the
TODOs), to resolve the problems fundamentally, it needs more work in the
future.
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 31, 2023

A hint: I guess we couldn't do settings.protect_protected_file_patterns=`"... '\;' ... " ;'):`` (eg: the last commit )

#23819 uses key="x='y'; z" , I guess it should work well for both Gitea and Crowdin. Let's wait for next sync.

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants