Skip to content

Commit

Permalink
Merge pull request #879 from ix5/i18n-tr-consolidate
Browse files Browse the repository at this point in the history
[client] i18n: Enable Turkish translations, add missing German strings
  • Loading branch information
ix5 authored May 23, 2022
2 parents c3e5618 + 1623466 commit 53183ab
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
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

0 comments on commit 53183ab

Please sign in to comment.