quip-apps-compat
Advanced tools
Comparing version 0.0.16 to 0.0.19
21
index.js
@@ -8,2 +8,4 @@ // Copyright 2018 Quip | ||
} | ||
var exports = module.exports = {}; | ||
// For quiptext, introduced in 0.1.044 | ||
@@ -74,2 +76,21 @@ var translationShim = function(text, placeholders) { | ||
} | ||
// Translated color label, until API implements these by default. | ||
var COLORS_TO_LABEL = { | ||
"RED": quiptext("Red"), | ||
"ORANGE": quiptext("Orange"), | ||
"YELLOW": quiptext("Yellow"), | ||
"GREEN": quiptext("Green"), | ||
"BLUE": quiptext("Blue"), | ||
"VIOLET": quiptext("Violet"), | ||
}; | ||
exports.localizedColorLabel = function(colorKey) { | ||
// Manually localize the color labels until the Quip Client API | ||
// translates its own strings as well. | ||
if (colorKey in COLORS_TO_LABEL) { | ||
return COLORS_TO_LABEL[colorKey]; | ||
} | ||
return colorKey.charAt(0).toUpperCase() + colorKey.slice(1).toLowerCase() | ||
} | ||
})(self); |
{ | ||
"name": "quip-apps-compat", | ||
"version": "0.0.16", | ||
"version": "0.0.19", | ||
"description": "Compat library for Quip Apps", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3755
89