diff --git a/README.prp.md b/README.prp.md index 0103645..3379741 100644 --- a/README.prp.md +++ b/README.prp.md @@ -18,7 +18,7 @@ An unofficial Java library for translating text using Azure AI Cognitive Service ## 📝 Documentation -- [VitePress Docs](https://brenoepics.github.io/at4j/) +- [AT4J Docs](https://brenoepics.github.io/at4j/) - [JavaDoc](https://brenoepics.github.io/at4j/javadoc/) ## 🎉 Basic Usage @@ -30,30 +30,29 @@ The following example translates a simple Hello World to Portuguese, Spanish and ```java public class ExampleTranslator { - - public static void main(String[] args) { - // Insert your Azure key and region here - String azureKey = ""; - String azureRegion = ""; - AzureApi api = new AzureApiBuilder().setKey(azureKey).region(azureRegion).build(); - - // Set up translation parameters - List targetLanguages = List.of("pt", "es", "fr"); - TranslateParams params = - new TranslateParams("Hello World!", targetLanguages).setSourceLanguage("en"); - - // Translate the text - Optional translationResult = api.translate(params).join(); - - // Print the translations - translationResult.ifPresent( - response -> - response.getFirstResult().getTranslations().forEach(ExampleTranslator::logLanguage)); - } - - public static void logLanguage(Translation translation) { - System.out.println(translation.getLanguageCode() + ": " + translation.getText()); - } + public static void main(String[] args) { + // Insert your Azure key and region here + String azureKey = ""; + String azureRegion = ""; + AzureApi api = new AzureApiBuilder().setKey(azureKey).region(azureRegion).build(); + + // Set up translation parameters + List < String > targetLanguages = List.of("pt", "es", "fr"); + TranslateParams params = + new TranslateParams("Hello World!", targetLanguages).setSourceLanguage("en"); + + // Translate the text + Optional < TranslationResponse > translationResult = api.translate(params).join(); + + // Print the translations + translationResult.ifPresent( + response -> + response.getFirstResult().getTranslations().forEach(ExampleTranslator::logLanguage)); + } + + public static void logLanguage(Translation translation) { + System.out.println(translation.getLanguageCode() + ": " + translation.getText()); + } } ```