Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize translation prompts #126

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/lobe-i18n/examples/locale/flat/locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"ok": "Ok",
"cancel": "Cancel"
},
"list": ["How are you", "I'm fine."],
"welcome": "Welcome!"
}
5 changes: 3 additions & 2 deletions packages/lobe-i18n/examples/locale/flat/locales/ja_JP.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"buttons": {
"ok": "OK",
"cancel": "キャンセル"
"cancel": "キャンセル",
"ok": "はい"
},
"list": ["γŠε…ƒζ°—γ§γ™γ‹", "私は元気です。"],
"welcome": "γ‚ˆγ†γ“γοΌ"
}
5 changes: 3 additions & 2 deletions packages/lobe-i18n/examples/locale/flat/locales/zh_CN.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"buttons": {
"ok": "Ok",
"cancel": "Cancel"
"cancel": "ε–ζΆˆ",
"ok": "ε₯½ηš„"
},
"list": ["δ½ ε₯½ε—", "ζˆ‘εΎˆε₯½γ€‚"],
"welcome": "欒迎!"
}
1 change: 1 addition & 0 deletions packages/lobe-i18n/src/prompts/translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const promptJsonTranslate = (reference: string = DEFAULT_REFERENCE) => {
`Translate the i18n JSON file from {from} to {to} according to the BCP 47 standard`,
`Here are some reference to help with better translation. ---${reference}---`,
`Keep the keys the same as the original file and make sure the output remains a valid i18n JSON file.`,
`Do not include any additional text or explanations outside the JSON object.Start directly with a left brace and end with a right brace.`,
]
.filter(Boolean)
.join('\n'),
Expand Down
Loading