intl-template 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/intl.js +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intl-template",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "l10n tagged template literals",
5
5
  "type": "module",
6
6
  "main": "dist/intl.js",
package/src/intl.js CHANGED
@@ -34,8 +34,10 @@ export function translate(locale, strings, ...parts) {
34
34
  const key = strings.join("{}")
35
35
  const translation = TRANSLATIONS?.[locale]
36
36
  let { template, order } = translation?.[key] || {}
37
- if (!template && import.meta?.env?.MODE === "development") {
38
- console.warn(`not match translate key, ${key}`, { translation, locale, strings, parts })
37
+ if (!template) {
38
+ if (import.meta?.env?.MODE === "development") {
39
+ console.warn(`not match translate key, ${key}`, { translation, locale, strings, parts })
40
+ }
39
41
  template = strings.slice()
40
42
  order = parts.map((_, i) => i)
41
43
  }