public async Task Check_DownloadContent() { // Arrange var remoteConfig = new RemoteContentConfig { CacheDir = Path.GetTempPath() }; var localConfig = new AssetsContentConfig { ResourceFolder = remoteConfig.CacheDir }; if (!Directory.Exists(localConfig.ResourceFolder)) { Directory.CreateDirectory(localConfig.ResourceFolder); } this.assetsTranslateContentClient = new AssetsTranslateContentClient(new PlatformComponentsFactory(), localConfig); var remoteTranslateContentClient = new RemoteTranslateContentClient(new PlatformComponentsFactory(), remoteConfig); var remoteLocale = new RemoteLocale("ru", RemoteTranslateContentClientTests.TestLocaleUrl); await remoteTranslateContentClient.GetContent(remoteLocale, null); var locales = this.assetsTranslateContentClient.GetLocales(); // Act var content = await this.assetsTranslateContentClient.GetContent(locales.First(), null, CancellationToken.None); // Assert Assert.IsNotEmpty(content); }
protected override void ReloadLocale() { var localeConfig = new AssetsContentConfig { ResourceFolder = "Locales" }; FriendlyLocale.I18N.Initialize(localeConfig); this.ReloadItems(); }
public static ITranslateContentClient Create( IPlatformComponentsFactory platformComponentsFactory, AssetsContentConfig contentConfig) { return(new AssetsTranslateContentClient(platformComponentsFactory, contentConfig)); }
public AssetsTranslateContentClient(IPlatformComponentsFactory platformComponentsFactory, AssetsContentConfig contentConfig) { this.platformResourceFileManager = platformComponentsFactory.CreateResourceFileManager(); this.contentConfig = contentConfig; }
public MvxYamlTextProvider(AssetsContentConfig config) { I18N.Initialize(config); }
public static void Initialize(AssetsContentConfig contentConfig) { InitializeInternal(TranslateContentClientFactory.Create(CreatePlatformComponentsFactory(), contentConfig)); }