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

[client] i18n: Enable Turkish translations, add missing German strings #879

Merged
merged 5 commits into from
May 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ Changelog for Isso
- Add ``data-isso-page-author-hashes`` option to client which makes it possible
to style comments and replies made by the page's author(s).
- Add Ukrainian localisation (`#878`_, okawo80085)
- Enable Turkish localisation (`#879`_, okawo80085)

.. _Gravatar: Image requests: http://en.gravatar.com/site/implement/images/
.. _878: https://github.com/posativ/isso/pull/878
.. _879: https://github.com/posativ/isso/pull/879

0.12.6 (2022-03-06)
-------------------
Expand Down
12 changes: 6 additions & 6 deletions isso/js/app/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var pt_PT = require("app/i18n/pt_PT");
var ru = require("app/i18n/ru");
var sk = require("app/i18n/sk");
var sv = require("app/i18n/sv");
var tr = require("app/i18n/tr");
var uk = require("app/i18n/uk");
var vi = require("app/i18n/vi");
var zh = require("app/i18n/zh_CN");
Expand All @@ -41,23 +42,25 @@ var pluralforms = function(lang) {
case "de":
case "el":
case "en":
case "es":
case "eo":
case "es":
case "fa":
case "fi":
case "hr":
case "hu":
case "it":
case "ko":
case "nl":
case "pt":
case "sv":
case "nl":
case "tr":
case "vi":
case "zh":
return function(msgs, n) {
return msgs[n === 1 ? 0 : 1];
};
case "fr":
case "oc":
return function(msgs, n) {
return msgs[n > 1 ? 1 : 0];
};
Expand All @@ -72,10 +75,6 @@ var pluralforms = function(lang) {
return typeof msgs[2] !== "undefined" ? msgs[2] : msgs[1];
}
};
case "oc":
return function(msgs, n) {
return msgs[n > 1 ? 1 : 0];
};
case "pl":
return function(msgs, n) {
if (n === 1) {
Expand Down Expand Up @@ -126,6 +125,7 @@ var catalogue = {
ru: ru,
sk: sk,
sv: sv,
tr: tr,
uk: uk,
vi: vi,
zh: zh_CN,
Expand Down
8 changes: 8 additions & 0 deletions isso/js/app/i18n/de.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
module.exports = {
"postbox-text": "Kommentar hier eingeben (mindestens 3 Zeichen)",
"postbox-author": "Name (optional)",
"postbox-author-placeholder": "Max Mustermann",
"postbox-email": "E-Mail (optional)",
"postbox-email-placeholder": "[email protected]",
"postbox-website": "Website (optional)",
"postbox-website-placeholder": "https://beispiel.de",
"postbox-preview": "Vorschau",
"postbox-edit": "Bearbeiten",
"postbox-submit": "Abschicken",
"postbox-notification": "wenn auf meinen Kommentar geantwortet wird, möchte ich eine E-Mail bekommen",

"num-comments": "1 Kommentar\n{{ n }} Kommentare",
"no-comments": "Bisher keine Kommentare",
"atom-feed": "Atom-feed",

"comment-reply": "Antworten",
"comment-edit": "Bearbeiten",
"comment-save": "Speichern",
Expand All @@ -20,6 +26,8 @@ module.exports = {
"comment-queued": "Kommentar muss noch freigeschaltet werden.",
"comment-anonymous": "Anonym",
"comment-hidden": "{{ n }} versteckt",
"comment-page-author-suffix": "Autor",

"date-now": "eben gerade",
"date-minute": "vor einer Minute\nvor {{ n }} Minuten",
"date-hour": "vor einer Stunde\nvor {{ n }} Stunden",
Expand Down
6 changes: 3 additions & 3 deletions isso/js/tests/unit/postbox-labels-optional.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test('"(optional)" labels in Postox vanish if require-author/-email set', () =>
'<div id=isso-thread></div>' +
'<script src="http://isso.api/js/embed.min.js"'
+ 'data-isso="/"'
+ 'data-isso-lang="de"' // falls back to "en" for placeholders
+ 'data-isso-lang="de"'
+ '></script>';

const isso = require("app/isso");
Expand All @@ -39,8 +39,8 @@ test('"(optional)" labels in Postox vanish if require-author/-email set', () =>
isso_thread.append('<div id="isso-root"></div>');
isso_thread.append(new isso.Postbox(null));

expect($("#isso-postbox-author").placeholder).toBe('John Doe');
expect($("#isso-postbox-email").placeholder).toBe('[email protected]');
expect($("#isso-postbox-author").placeholder).toBe('Max Mustermann');
expect($("#isso-postbox-email").placeholder).toBe('[email protected]');
// Instead of "Name (optional)"
expect($("[for='isso-postbox-author']").textContent).toBe('Name');
// Instead of "E-mail (optional)"
Expand Down