32 enum class NotifyMode : uchar {
41 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ImmutableLocalization const>> mCurrentLanguage;
42 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ImmutableLocalization const>> mCurrentPackMetaLanguage;
46 using LockedCurrentLanguageInfo =
52 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Localization const>> mEmptyLanguage;
53 ::ll::TypedStorage<8, 40, ::Bedrock::Threading::SharedLockbox<::I18nImpl::CurrentLanguageInfo, ::std::shared_mutex>>
55 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::ImmutableLocalization>>> mLanguages;
56 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mLanguageCodes;
57 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::string>> mLanguageNames;
61 ::Bedrock::Threading::
62 SharedLockbox<::std::vector<::std::shared_ptr<::ImmutableLocalization>>, ::std::shared_mutex>>
63 mPackKeywordLanguages;
64 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>
const> mPackReservedKeys;
65 ::ll::TypedStorage<1, 1, bool> mLanguageSupportsHypenSplitting;
66 ::ll::TypedStorage<8, 8, ::ResourcePackManager*> mResourcePackManager;
67 ::ll::TypedStorage<8, 8, ::std::shared_mutex> mAdditionalTranslationsBackupMutex;
68 ::ll::TypedStorage<8, 24, ::std::vector<::ImmutableLocalization>> mAdditionalTranslationsBackup;
69 ::ll::TypedStorage<8, 8, ::std::shared_mutex> mLocalizationMutex;
70 ::ll::TypedStorage<8, 104, ::Core::Subject<::I18nObserver, ::std::mutex>> mSubject;
76 virtual void clearLanguages() ;
78 virtual ::std::vector<::std::string>
81 virtual ::std::unordered_map<::std::string, ::std::string>
84 virtual ::Bedrock::Threading::Async<void> loadLanguages(
86 ::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> resourceLoadManager,
87 ::std::string
const& initLang
92 virtual ::std::vector<::std::string>
95 virtual void loadLanguageKeywordsFromPack(
100 virtual void loadLanguageKeywordsFromPack(
103 ::std::vector<::std::string>
const& languageCodes,
104 ::std::optional<::std::vector<::std::string>>
const& additionalLocKeys
107 virtual void appendLanguageStringsFromPack(
109 ::std::multimap<::std::string, ::std::pair<::std::string, ::std::string>>
const& localizationMapping
112 virtual ::std::unordered_map<::std::string, ::std::string>
113 getLanguageKeywordsFromPack(
::PackManifest const& manifest, ::std::string
const& keyword) ;
115 virtual void loadLangaugesByLocale(
116 ::std::unordered_multimap<::std::string, ::std::pair<::std::string, ::std::string>>
const& storeLocalization
119 virtual void appendAdditionalTranslations(
120 ::std::unordered_map<::std::string, ::std::string>
const& translations,
121 ::std::string
const& keyPrefix
128 virtual void chooseLanguage(::std::string
const&
code) ;
130 virtual ::std::string
131 get(::std::string
const&
id,
132 ::std::vector<::std::string>
const& params,
133 ::std::shared_ptr<::Localization const>
const locale) ;
135 virtual ::std::string
136 get(::std::string
const& langString, ::std::shared_ptr<::Localization const>
const locale) ;
138 virtual ::std::string getPackKeywordValue(
::PackManifest const& manifest, ::std::string
const& key) ;
140 virtual ::std::string
141 getPackKeywordValueForTelemetry(
::PackManifest const& manifest, ::std::string
const& key) ;
143 virtual bool hasPackKeyEntry(
::PackManifest const& manifest, ::std::string
const& key) ;
145 virtual ::std::vector<::std::string>
const& getSupportedLanguageCodes() ;
147 virtual ::std::string
const& getLanguageName(::std::string
const&
code) ;
149 virtual ::std::shared_ptr<::Localization const>
const getLocaleFor(::std::string
const&
code) ;
151 virtual ::std::string
const& getLocaleCodeFor(::std::string
const&
code) ;
153 virtual ::gsl::not_null<::std::shared_ptr<::Localization const>> getCurrentLanguage() ;
155 virtual bool languageSupportsHypenSplitting() ;
157 virtual ::std::string getLocalizedAssetFileWithFallback(
158 ::std::string
const& fileNamePrefix,
159 ::std::string
const& fileNameSuffix
162 virtual bool isPackKeyword(::std::string
const& key) ;
170 MCAPI
void _chooseLanguage(::std::shared_ptr<::ImmutableLocalization> chosen, ::I18nImpl::NotifyMode notify);
172 MCAPI ::std::shared_ptr<::ImmutableLocalization> _findLocaleFor(::std::string
const&
code);
174 MCAPI ::std::string _generatePackKeyPrefix(
::PackManifest const& manifest);
176 MCAPI ::std::string& _getLocaleCodeFor(::std::string
const&
code);
178 MCAPI ::gsl::not_null<::std::shared_ptr<::ImmutableLocalization>>
179 _getPackKeywordLocale(::std::string
const& langCode);
185 MCAPI
static void _findAvailableLanguages(
::Json::Value const& root, ::std::vector<::std::string>& destination);
197 MCAPI
void $clearLanguages();
199 MCAPI ::std::vector<::std::string> $findAvailableLanguages(
::ResourcePackManager& resourcePackManager);
201 MCAPI ::std::unordered_map<::std::string, ::std::string>
204 MCAPI ::Bedrock::Threading::Async<void> $loadLanguages(
206 ::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> resourceLoadManager,
207 ::std::string
const& initLang
212 MCAPI ::std::vector<::std::string> $getLanguageCodesFromPack(
::PackAccessStrategy const& accessStrategy);
217 MCAPI
void $loadLanguageKeywordsFromPack(
220 ::std::vector<::std::string>
const& languageCodes,
221 ::std::optional<::std::vector<::std::string>>
const& additionalLocKeys
224 MCAPI
void $appendLanguageStringsFromPack(
226 ::std::multimap<::std::string, ::std::pair<::std::string, ::std::string>>
const& localizationMapping
229 MCAPI ::std::unordered_map<::std::string, ::std::string>
230 $getLanguageKeywordsFromPack(
::PackManifest const& manifest, ::std::string
const& keyword);
232 MCAPI
void $loadLangaugesByLocale(
233 ::std::unordered_multimap<::std::string, ::std::pair<::std::string, ::std::string>>
const& storeLocalization
236 MCAPI
void $appendAdditionalTranslations(
237 ::std::unordered_map<::std::string, ::std::string>
const& translations,
238 ::std::string
const& keyPrefix
245 MCAPI
void $chooseLanguage(::std::string
const&
code);
247 MCAPI ::std::string $get(
248 ::std::string
const&
id,
249 ::std::vector<::std::string>
const& params,
250 ::std::shared_ptr<::Localization const>
const locale
253 MCAPI ::std::string $get(::std::string
const& langString, ::std::shared_ptr<::Localization const>
const locale);
255 MCAPI ::std::string $getPackKeywordValue(
::PackManifest const& manifest, ::std::string
const& key);
257 MCAPI ::std::string $getPackKeywordValueForTelemetry(
::PackManifest const& manifest, ::std::string
const& key);
259 MCAPI
bool $hasPackKeyEntry(
::PackManifest const& manifest, ::std::string
const& key);
261 MCFOLD ::std::vector<::std::string>
const& $getSupportedLanguageCodes();
263 MCAPI ::std::string
const& $getLanguageName(::std::string
const&
code);
265 MCAPI ::std::shared_ptr<::Localization const>
const $getLocaleFor(::std::string
const&
code);
267 MCAPI ::std::string
const& $getLocaleCodeFor(::std::string
const&
code);
269 MCAPI ::gsl::not_null<::std::shared_ptr<::Localization const>> $getCurrentLanguage();
271 MCAPI
bool $languageSupportsHypenSplitting();
274 $getLocalizedAssetFileWithFallback(::std::string
const& fileNamePrefix, ::std::string
const& fileNameSuffix);
276 MCAPI
bool $isPackKeyword(::std::string
const& key);