mirror of https://github.com/abpframework/abp.git
committed by
GitHub
33 changed files with 332 additions and 34 deletions
@ -0,0 +1,51 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Globalization; |
|||
|
|||
namespace Volo.Docs; |
|||
|
|||
public class DocsWebGoogleTranslationOptions |
|||
{ |
|||
public bool UseGoogleTranslation { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// https://cloud.google.com/translate/docs/languages
|
|||
/// </summary>
|
|||
public List<string> IncludedLanguages { get; set; } |
|||
|
|||
public Func<CultureInfo, string> GetCultureLanguageCode { get; set; } |
|||
|
|||
public DocsWebGoogleTranslationOptions() |
|||
{ |
|||
UseGoogleTranslation = false; |
|||
IncludedLanguages = |
|||
[ |
|||
"en", |
|||
"tr", |
|||
"zh-CN", |
|||
"zh-TW", |
|||
"ar", |
|||
"cs", |
|||
"hu", |
|||
"hr", |
|||
"fi", |
|||
"fr", |
|||
"hi", |
|||
"it", |
|||
"pt", |
|||
"ru", |
|||
"sk", |
|||
"de", |
|||
"es" |
|||
]; |
|||
GetCultureLanguageCode = culture => |
|||
{ |
|||
return culture.Name switch |
|||
{ |
|||
"zh-Hans" => "zh-CN", |
|||
"zh-Hant" => "zh-TW", |
|||
_ => culture.TwoLetterISOLanguageName |
|||
}; |
|||
}; |
|||
} |
|||
} |
|||
Loading…
Reference in new issue