-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from FlexConfirmMail/add-en-and-zh-locales
Add en and zh-CN locales
- Loading branch information
Showing
11 changed files
with
166 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"confirmation_trustedCaption": "Internal Recipients", | ||
"confirmation_trustedCheckAllButtonLabel": "Check all", | ||
"confirmation_untrustedCaption": "External Recipients", | ||
"confirmation_miscCaption": "Attachments / Warnings", | ||
"confirmation_sendButtonLabel": "Send", | ||
"confirmation_cancelButtonLabel": "Cancel", | ||
|
||
"confirmation_safeBccThresholdCheckboxLabel": "[Warn] To/Cc fields contain no less than ${threshold} domains", | ||
"confirmation_unsafeDomainRecipientCheckboxLabel": "[Warn] An unsafe domain \"${domain}\" found in the recipient list", | ||
"confirmation_unsafeRecipientCheckboxLabel": "[Warn] An unsafe address \"${address}\" found in the recipient list", | ||
"confirmation_unsafeAttachmentCheckboxLabel": "[Warn] An unsafe keyword (${name}) found in the attachment list", | ||
"confirmation_attachmentCheckboxLabel": "[Attachment] ${name}", | ||
|
||
"newlyAddedDomainReconfirmation_caption": "CAUTION!", | ||
"newlyAddedDomainReconfirmation_messageBefore": "There are recipients with domains not included in the recipients of the original message.", | ||
"newlyAddedDomainReconfirmation_messageAfter": "Do you really want to send this message?", | ||
"newlyAddedDomainReconfirmation_sendButtonLabel": "Send", | ||
"newlyAddedDomainReconfirmation_cancelButtonLabel": "Cancel", | ||
|
||
"countDown_messageBefore": "", | ||
"countDown_messageAfter": "seconds to send", | ||
"countDown_sendButtonLabel": "Send Now", | ||
"countDown_cancelButtonLabel": "Cancel" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"confirmation_trustedCaption": "信任域,地址", | ||
"confirmation_trustedCheckAllButtonLabel": "勾选所有", | ||
"confirmation_untrustedCaption": "外部目的地", | ||
"confirmation_miscCaption": "附件 / 警告", | ||
"confirmation_sendButtonLabel": "发送", | ||
"confirmation_cancelButtonLabel": "取消", | ||
|
||
"confirmation_safeBccThresholdCheckboxLabel": "[警告] To/Cc 包含${threshold}个以上的域", | ||
"confirmation_unsafeDomainRecipientCheckboxLabel": "[警告] 包含不安全的域 (${domain})", | ||
"confirmation_unsafeRecipientCheckboxLabel": "[警告] 包含不安全地址 (${address})", | ||
"confirmation_unsafeAttachmentCheckboxLabel": "[警告] 包含不安全的文件名 (${name})", | ||
"confirmation_attachmentCheckboxLabel": "[附件] ${name}", | ||
|
||
"newlyAddedDomainReconfirmation_caption": "警告!", | ||
"_newlyAddedDomainReconfirmation_messageBefore": "There are recipients with domains not included in the recipients of the original message.", | ||
"_newlyAddedDomainReconfirmation_messageAfter": "Do you really want to send this message?", | ||
"newlyAddedDomainReconfirmation_sendButtonLabel": "发送", | ||
"newlyAddedDomainReconfirmation_cancelButtonLabel": "取消", | ||
|
||
"countDown_messageBefore": "", | ||
"countDown_messageAfter": "秒后发送", | ||
"countDown_sendButtonLabel": "现在发送", | ||
"countDown_cancelButtonLabel": "取消" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"effectiveMessage": "Message with effective content", | ||
"blankMessage": "Blank message", | ||
"messageWithPlaceholders": "Message with placeholders: ${one}, ${two}", | ||
"missingFallbackMessage": "Message defined in fallback locales", | ||
"missingMessage": "Message not defined in non-default locales" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"effectiveMessage": "JP:意味ある内容を含むメッセージ", | ||
"blankMessage": "", | ||
"messageWithPlaceholders": "JP:プレースホルダーを含むメッセージ:${one}, ${two}, ${three}", | ||
"_missingFallbackMessage": "JP:フォールバック先で定義されているメッセージ", | ||
"_missingMessage": "JP:未定義のメッセージ" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"effectiveMessage": "意味ある内容を含むメッセージ", | ||
"blankMessage": "空のメッセージ", | ||
"messageWithPlaceholders": "プレースホルダーを含むメッセージ:${one}, ${two}", | ||
"missingFallbackMessage": "フォールバック先で定義されているメッセージ", | ||
"_missingMessage": "未定義のメッセージ" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
'use strict'; | ||
|
||
import "./l10n.mjs"; | ||
import { L10n } from "../../src/web/l10n.mjs"; | ||
import { assert } from "tiny-esm-test-runner"; | ||
const { is } = assert; | ||
|
||
async function prepare(language) { | ||
L10n.clearCache(); | ||
L10n.baseUrl = (new URL(`${import.meta.url}/../../fixtures/`)).toString(); | ||
const l10n = new L10n(language); | ||
await l10n.ready; | ||
return l10n; | ||
} | ||
|
||
test_get.parameters = { | ||
effective: { | ||
language: "ja-JP", | ||
key: "effectiveMessage", | ||
expected: "JP:意味ある内容を含むメッセージ", | ||
}, | ||
blank: { | ||
language: "ja-JP", | ||
key: "blankMessage", | ||
expected: "", | ||
}, | ||
withPlaceholders: { | ||
language: "ja-JP", | ||
key: "messageWithPlaceholders", | ||
params: { | ||
one: "One", | ||
two: "Two", | ||
}, | ||
expected: "JP:プレースホルダーを含むメッセージ:One, Two, ${three}", | ||
}, | ||
fallbackToGeneralLocale: { | ||
language: "ja-JP", | ||
key: "missingFallbackMessage", | ||
expected: "フォールバック先で定義されているメッセージ", | ||
}, | ||
fallbackToDefaultLocale: { | ||
language: "ja-JP", | ||
key: "missingMessage", | ||
expected: "Message not defined in non-default locales", | ||
}, | ||
differentLocale: { | ||
language: "en", | ||
key: "effectiveMessage", | ||
expected: "Message with effective content", | ||
}, | ||
undefinedMessage: { | ||
language: "en", | ||
key: "undefinedMessage", | ||
expected: "undefinedMessage", | ||
} | ||
}; | ||
export async function test_get({ language, key, params, expected }) { | ||
const l10n = await prepare(language); | ||
is(expected, l10n.get(key, params || null)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters