Add Zotero.Utilities.Internal.stringWithColon() for localized colons

Generally just a colon, but, e.g., French adds a space before it. We'll
want to replace uses of `punctuation.colon` with this.
This commit is contained in:
Dan Stillman 2022-10-24 19:49:10 -04:00
parent 70f9462913
commit 159c112257
2 changed files with 13 additions and 0 deletions

View file

@ -1561,6 +1561,18 @@ Zotero.Utilities.Internal = {
},
/**
* Adds a localized colon to a string (which is usually just a colon, but, e.g., in French
* there's a space before it)
*
* @param {String}
* @return {String}
*/
stringWithColon: function (str) {
return Zotero.getString('punctuation.colon.withString', str);
},
resolveLocale: function (locale, locales) {
// If the locale exists as-is, use it
if (locales.includes(locale)) {

View file

@ -116,6 +116,7 @@ about.getInvolved = Want to help? [Get involved] today!
punctuation.openingQMark =
punctuation.closingQMark =
punctuation.colon = :
punctuation.colon.withString = %S:
punctuation.ellipsis =
install.quickStartGuide = Zotero Quick Start Guide