public static void AddGoogleSheetI18n(this IServiceCollection services, IConfiguration configuration)
        {
            var i18nOptions = AddOptions(services, configuration);

            var i18nLocalStore = new I18nLocalStore(i18nOptions.LocalStorePath);

            services.AddSingleton(i18nLocalStore);

            var i18nCache = new I18nCache();

            services.AddSingleton(i18nCache);

            services.AddSingleton <II18nLocalStore>(new I18nCachableLocalStore(i18nLocalStore, i18nCache));

            var i18nGoogleClient = new I18nGoogleClient(i18nOptions.CredentialsFilePath);

            services.AddSingleton <II18nGoogleClient>(i18nGoogleClient);

            services.AddSingleton <II18nCodeTranslation>(new I18nCodeTranslation());
        }
Example #2
0
        public async Task Setup()
        {
            var i18nClient = new I18nGoogleClient();

            _sheets = await i18nClient.GetSheets(_spreadsheetId);
        }