34 enum class NotifyMode : uchar {
43 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ImmutableLocalization const>> mCurrentLanguage;
44 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ImmutableLocalization const>> mCurrentPackMetaLanguage;
48 using LockedCurrentLanguageInfo =
54 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Localization const>> mEmptyLanguage;
55 ::ll::TypedStorage<8, 40, ::Bedrock::Threading::SharedLockbox<::I18nImpl::CurrentLanguageInfo, ::std::shared_mutex>>
57 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::ImmutableLocalization>>> mLanguages;
58 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mLanguageCodes;
59 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::string>> mLanguageNames;
63 ::Bedrock::Threading::
64 SharedLockbox<::std::vector<::std::shared_ptr<::ImmutableLocalization>>, ::std::shared_mutex>>
65 mPackKeywordLanguages;
66 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>
const> mPackReservedKeys;
67 ::ll::TypedStorage<1, 1, bool> mLanguageSupportsHypenSplitting;
68 ::ll::TypedStorage<8, 8, ::ResourcePackManager*> mResourcePackManager;
69 ::ll::TypedStorage<8, 8, ::std::shared_mutex> mAdditionalTranslationsBackupMutex;
70 ::ll::TypedStorage<8, 24, ::std::vector<::ImmutableLocalization>> mAdditionalTranslationsBackup;
71 ::ll::TypedStorage<8, 8, ::std::shared_mutex> mLocalizationMutex;
72 ::ll::TypedStorage<8, 104, ::Core::Subject<::I18nObserver, ::Bedrock::Threading::Mutex>> mSubject;
78 virtual void clearLanguages() ;
80 virtual ::std::vector<::std::string>
83 virtual ::std::unordered_map<::std::string, ::std::string>
86 virtual ::Bedrock::Threading::Async<void> loadLanguages(
88 ::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> resourceLoadManager,
89 ::std::string
const& initLang
94 virtual ::std::vector<::std::string>
97 virtual void loadLanguageKeywordsFromPack(
102 virtual void loadLanguageKeywordsFromPack(
105 ::std::vector<::std::string>
const& languageCodes,
106 ::std::optional<::std::vector<::std::string>>
const& additionalLocKeys
109 virtual void appendLanguageStringsFromPack(
111 ::std::multimap<::std::string, ::std::pair<::std::string, ::std::string>>
const& localizationMapping
114 virtual ::std::unordered_map<::std::string, ::std::string>
115 getLanguageKeywordsFromPack(
::PackManifest const& manifest, ::std::string
const& keyword) ;
117 virtual void loadLangaugesByLocale(
118 ::std::unordered_multimap<::std::string, ::std::pair<::std::string, ::std::string>>
const& storeLocalization
121 virtual void appendAdditionalTranslations(
122 ::std::unordered_map<::std::string, ::std::string>
const& translations,
123 ::std::string
const& keyPrefix
130 virtual void chooseLanguage(::std::string
const&
code) ;
132 virtual ::std::string
133 get(::std::string
const&
id,
134 ::std::vector<::std::string>
const& params,
135 ::std::shared_ptr<::Localization const>
const locale) ;
137 virtual ::std::string
138 get(::std::string
const& langString, ::std::shared_ptr<::Localization const>
const locale) ;
140 virtual ::std::string getPackKeywordValue(
::PackManifest const& manifest, ::std::string
const& key) ;
142 virtual ::std::string
143 getPackKeywordValueForTelemetry(
::PackManifest const& manifest, ::std::string
const& key) ;
145 virtual bool hasPackKeyEntry(
::PackManifest const& manifest, ::std::string
const& key) ;
147 virtual ::std::vector<::std::string>
const& getSupportedLanguageCodes() ;
149 virtual ::std::string
const& getLanguageName(::std::string
const&
code) ;
151 virtual ::std::shared_ptr<::Localization const>
const getLocaleFor(::std::string
const&
code) ;
153 virtual ::std::string
const& getLocaleCodeFor(::std::string
const&
code) ;
155 virtual ::gsl::not_null<::std::shared_ptr<::Localization const>> getCurrentLanguage() ;
157 virtual bool languageSupportsHypenSplitting() ;
159 virtual ::std::string getLocalizedAssetFileWithFallback(
160 ::std::string
const& fileNamePrefix,
161 ::std::string
const& fileNameSuffix
164 virtual bool isPackKeyword(::std::string
const& key) ;
172 MCAPI
void _chooseLanguage(::std::shared_ptr<::ImmutableLocalization> chosen, ::I18nImpl::NotifyMode notify);
174 MCAPI
void _findAvailableLanguageNames(
176 ::std::unordered_map<::std::string, ::std::string>& destination
179 MCAPI
void _findAvailableLanguages(
::Json::Value const& root, ::std::vector<::std::string>& destination);
181 MCAPI ::std::shared_ptr<::ImmutableLocalization> _findLocaleFor(::std::string
const&
code);
183 MCAPI ::std::string _generatePackKeyPrefix(
::PackManifest const& manifest);
185 MCAPI ::std::string& _getLocaleCodeFor(::std::string
const&
code);
187 MCAPI ::gsl::not_null<::std::shared_ptr<::ImmutableLocalization>>
188 _getPackKeywordLocale(::std::string
const& langCode);
190 MCAPI
void _setLanguageSupportsHypenSplitting(
::Localization const& localization);
202 MCAPI
void $clearLanguages();
204 MCAPI ::std::vector<::std::string> $findAvailableLanguages(
::ResourcePackManager& resourcePackManager);
206 MCAPI ::std::unordered_map<::std::string, ::std::string>
209 MCAPI ::Bedrock::Threading::Async<void> $loadLanguages(
211 ::Bedrock::NotNullNonOwnerPtr<::ResourceLoadManager> resourceLoadManager,
212 ::std::string
const& initLang
217 MCAPI ::std::vector<::std::string> $getLanguageCodesFromPack(
::PackAccessStrategy const& accessStrategy);
222 MCAPI
void $loadLanguageKeywordsFromPack(
225 ::std::vector<::std::string>
const& languageCodes,
226 ::std::optional<::std::vector<::std::string>>
const& additionalLocKeys
229 MCAPI
void $appendLanguageStringsFromPack(
231 ::std::multimap<::std::string, ::std::pair<::std::string, ::std::string>>
const& localizationMapping
234 MCAPI ::std::unordered_map<::std::string, ::std::string>
235 $getLanguageKeywordsFromPack(
::PackManifest const& manifest, ::std::string
const& keyword);
237 MCAPI
void $loadLangaugesByLocale(
238 ::std::unordered_multimap<::std::string, ::std::pair<::std::string, ::std::string>>
const& storeLocalization
241 MCAPI
void $appendAdditionalTranslations(
242 ::std::unordered_map<::std::string, ::std::string>
const& translations,
243 ::std::string
const& keyPrefix
250 MCAPI
void $chooseLanguage(::std::string
const&
code);
252 MCAPI ::std::string $get(
253 ::std::string
const&
id,
254 ::std::vector<::std::string>
const& params,
255 ::std::shared_ptr<::Localization const>
const locale
258 MCAPI ::std::string $get(::std::string
const& langString, ::std::shared_ptr<::Localization const>
const locale);
260 MCAPI ::std::string $getPackKeywordValue(
::PackManifest const& manifest, ::std::string
const& key);
262 MCAPI ::std::string $getPackKeywordValueForTelemetry(
::PackManifest const& manifest, ::std::string
const& key);
264 MCAPI
bool $hasPackKeyEntry(
::PackManifest const& manifest, ::std::string
const& key);
266 MCFOLD ::std::vector<::std::string>
const& $getSupportedLanguageCodes();
268 MCAPI ::std::string
const& $getLanguageName(::std::string
const&
code);
270 MCAPI ::std::shared_ptr<::Localization const>
const $getLocaleFor(::std::string
const&
code);
272 MCAPI ::std::string
const& $getLocaleCodeFor(::std::string
const&
code);
274 MCAPI ::gsl::not_null<::std::shared_ptr<::Localization const>> $getCurrentLanguage();
276 MCAPI
bool $languageSupportsHypenSplitting();
279 $getLocalizedAssetFileWithFallback(::std::string
const& fileNamePrefix, ::std::string
const& fileNameSuffix);
281 MCAPI
bool $isPackKeyword(::std::string
const& key);