Skip to content

Commit

Permalink
Translator: Implement sourceLanguage and targetLanguage attributes
Browse files Browse the repository at this point in the history
Implements the sourceLanguage and targetLanguage attributes.

Bug: 391439683
Change-Id: I7dde1a78de30ad959ca92ee424596fb7442786b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6186019
Commit-Queue: Nathan Memmott <[email protected]>
Reviewed-by: Ming-Ying Chung <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1409688}
  • Loading branch information
Nathan Memmott authored and chromium-wpt-export-bot committed Jan 22, 2025
1 parent 8d6d3ba commit d7ef1ba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ai/translator/ai_translator_translate.tentative.https.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ promise_test(async t => {
});
assert_equals(await translator.translate('hello'), 'こんにちは');
});

promise_test(async t => {
const translator =
await ai.translator.create({sourceLanguage: 'en', targetLanguage: 'ja'});
assert_equals(translator.sourceLanguage, 'en');
assert_equals(translator.targetLanguage, 'ja');
}, 'AITranslator: sourceLanguage and targetLanguage are equal to their respective option passed in to AITranslatorFactory.create.')

0 comments on commit d7ef1ba

Please sign in to comment.