-
Notifications
You must be signed in to change notification settings - Fork 537
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
Add function for translation of UI elements #1057
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
change_language = "" | ||
improve_this_page = "" | ||
how_to_improve_this_page = "" | ||
contribution_guidlines_on_github = "" | ||
submit_a_pull_request = "" | ||
report_a_bug = "" | ||
add_a_note = "" | ||
user_contributed_notes = "" | ||
no_user_notes = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
change_language = "Change language" | ||
improve_this_page = "Improve This Page" | ||
how_to_improve_this_page = "Learn How To Improve This Page" | ||
contribution_guidlines_on_github = "This will take you to our contribution guidelines on GitHub" | ||
submit_a_pull_request = "Submit a Pull Request" | ||
report_a_bug = "Report a Bug" | ||
add_a_note = "add a note" | ||
user_contributed_notes = "User Contributed Notes" | ||
no_user_notes = "There are no user contributed notes for this page." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
change_language = "" | ||
improve_this_page = "" | ||
how_to_improve_this_page = "" | ||
contribution_guidlines_on_github = "" | ||
submit_a_pull_request = "" | ||
report_a_bug = "" | ||
add_a_note = "" | ||
user_contributed_notes = "" | ||
no_user_notes = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
change_language = "" | ||
improve_this_page = "" | ||
how_to_improve_this_page = "" | ||
contribution_guidlines_on_github = "" | ||
submit_a_pull_request = "" | ||
report_a_bug = "" | ||
add_a_note = "" | ||
user_contributed_notes = "" | ||
no_user_notes = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
change_language = "" | ||
improve_this_page = "" | ||
how_to_improve_this_page = "" | ||
contribution_guidlines_on_github = "" | ||
submit_a_pull_request = "" | ||
report_a_bug = "" | ||
add_a_note = "" | ||
user_contributed_notes = "" | ||
no_user_notes = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
change_language = "" | ||
improve_this_page = "" | ||
how_to_improve_this_page = "" | ||
contribution_guidlines_on_github = "" | ||
submit_a_pull_request = "" | ||
report_a_bug = "" | ||
add_a_note = "" | ||
user_contributed_notes = "" | ||
no_user_notes = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
change_language = "" | ||
improve_this_page = "" | ||
how_to_improve_this_page = "" | ||
contribution_guidlines_on_github = "" | ||
submit_a_pull_request = "" | ||
report_a_bug = "" | ||
add_a_note = "" | ||
user_contributed_notes = "" | ||
no_user_notes = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
change_language = "" | ||
improve_this_page = "" | ||
how_to_improve_this_page = "" | ||
contribution_guidlines_on_github = "" | ||
submit_a_pull_request = "" | ||
report_a_bug = "" | ||
add_a_note = "" | ||
user_contributed_notes = "" | ||
no_user_notes = "" | ||
saundefined marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
change_language = "" | ||
improve_this_page = "" | ||
how_to_improve_this_page = "" | ||
contribution_guidlines_on_github = "" | ||
submit_a_pull_request = "" | ||
report_a_bug = "" | ||
add_a_note = "" | ||
user_contributed_notes = "" | ||
no_user_notes = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
change_language = "" | ||
improve_this_page = "" | ||
how_to_improve_this_page = "" | ||
contribution_guidlines_on_github = "" | ||
submit_a_pull_request = "" | ||
report_a_bug = "" | ||
add_a_note = "" | ||
user_contributed_notes = "" | ||
no_user_notes = "" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
$noteCountHtml = "<span class=\"count\">$num_notes " . ($num_notes == 1 ? $note : $notes) . "</span>";
to allow translation of the number of notes beside the title?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that would be much better! Appending an "s" works for few languages. However, pluralization is more difficult than distinguishing between singular and plural (@mvorisek can probably confirm for the Czech language), but it might be okay for the currently active languages (and we could still extend).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm appending
s
to make words plular is NOT how Czech language works. We change the word ending based on many rules.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also for Italian the plurals are not formed by appending
s
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or use the more universal format «notes: N»,
because, for example, in Russian (I guess it's not the only language),
different endings will be for 1, 3, and 5 notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I was referring to regarding the Czech language. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is why
gettext
hasngettext()
, but maybe using that would be overkill for this issue. If there was interest in doing more widespread internationalization of the PHP website, that could be a way to go.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that doing this is a good idea but I would prefer not to do it as part of this PR. The changes in this PR address the simpler issue of translating the static elements of the documentation UI. Looking at the above discussion on the intricacies of translating the number of notes to various languages (and we haven't even heard from the Chinese or Japanese doc maintainers on the subject), I think all that needs a bit more thought put into it and should be split into its own PR.
So my suggestion is for this PR to only address the translation of the static elements of the doc pages and to open a new PR for the dynamic elements. Maybe even open an issue first and ask maintainers of every language repo to discuss how the dynamic elements (the total note count, the number of upvotes/downvotes and how long ago a note was submitted) can be translated to each of their respective languages and open a PR once it is clear how to adequately implement it for each of those languages.