override translation strings using data attributes
This commit is contained in:
parent
40d011e6bb
commit
47a5b2c84b
@ -31,6 +31,14 @@ the embed tag, as well as the thread ID, e.g.:
|
|||||||
|
|
||||||
<section id="isso-thread" data-title="Foo!" data-isso-id="/path/to/resource"></section>
|
<section id="isso-thread" data-title="Foo!" data-isso-id="/path/to/resource"></section>
|
||||||
|
|
||||||
|
Additionally, you can override any translation string for any language by adding
|
||||||
|
a `data-isso-` attribute that is equal to the translation key (found `here`__) with
|
||||||
|
`-text-[lang]` appended to it. So, for example, if you want to override the
|
||||||
|
english translation of the `postbox-notification` message, you could add
|
||||||
|
`data-isso-postbox-notification-lang-en="Select to be notified of replies to your comment"`
|
||||||
|
|
||||||
|
.. __: https://github.com/posativ/isso/blob/master/isso/js/app/i18n/en.js
|
||||||
|
|
||||||
data-isso
|
data-isso
|
||||||
---------
|
---------
|
||||||
|
|
||||||
@ -116,7 +124,7 @@ and not a multiple of 2, the color distribution is not even.
|
|||||||
data-isso-gravatar
|
data-isso-gravatar
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
Uses gravatar images instead of generating svg images. You have to set
|
Uses gravatar images instead of generating svg images. You have to set
|
||||||
"data-isso-avatar" to **false** when you want to use this. Otherwise
|
"data-isso-avatar" to **false** when you want to use this. Otherwise
|
||||||
both the gravatar and avatar svg image will show up. Please also set
|
both the gravatar and avatar svg image will show up. Please also set
|
||||||
option "gravatar" to **true** in the server configuration...
|
option "gravatar" to **true** in the server configuration...
|
||||||
|
@ -85,7 +85,10 @@ define(["app/config", "app/i18n/bg", "app/i18n/cs", "app/i18n/da",
|
|||||||
var plural = pluralforms(lang);
|
var plural = pluralforms(lang);
|
||||||
|
|
||||||
var translate = function(msgid) {
|
var translate = function(msgid) {
|
||||||
return catalogue[lang][msgid] || en[msgid] || "???";
|
return config[msgid + '-text-' + lang] ||
|
||||||
|
catalogue[lang][msgid] ||
|
||||||
|
en[msgid] ||
|
||||||
|
"???";
|
||||||
};
|
};
|
||||||
|
|
||||||
var pluralize = function(msgid, n) {
|
var pluralize = function(msgid, n) {
|
||||||
|
Loading…
Reference in New Issue
Block a user