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

Add method to get translation language names #1148

Merged
merged 1 commit into from
Jun 27, 2017

Conversation

marcominerva
Copy link
Contributor

TranslatorService now contains a new method that can be used to automatically get friendly language names.

var doc = XDocument.Parse(content);
var detectedLanguage = doc.Root.Value;

return detectedLanguage;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a cool feature. Just wondering, is it possible to return a ServiceLanguage here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is surely possible, but another call to the service will be necessary for each detection, unless I keep a local cache of all the Language Names. Otherwise, you need to manually call GetLanguageNamesAsync method and then keep the ServiceLanguage list in our app, in order to retrive the full name corresponding to the detected language.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me, let's keep it like this :)

@nmetulev nmetulev added this to the v1.5 milestone May 15, 2017
@shenchauhan shenchauhan merged commit 59038c6 into CommunityToolkit:dev Jun 27, 2017
@shenchauhan
Copy link
Contributor

Merging but requires documentation so adding an issue for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants