Skip to content

Commit

Permalink
On Android, language codes are formatted if necessary (e.g. en-US is …
Browse files Browse the repository at this point in the history
…converted to values-en-rUS)
  • Loading branch information
yasirkula committed May 1, 2023
1 parent ce28336 commit f609e8d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,10 @@ private void GenerateAndroidResources()
{
string languageCode = LocalizedData[i].LanguageCode;
int languageSubCodeIndex = languageCode.IndexOf( '-' );
if( languageSubCodeIndex > 0 )
if( languageSubCodeIndex > 0 && languageCode[languageSubCodeIndex + 1] != 'r' )
{
string _languageCode = languageCode;
languageCode = languageCode.Substring( 0, languageSubCodeIndex );

Debug.LogWarning( "(LocalizedAppTitle) Android doesn't support language sub-codes, changing " + _languageCode + " to " + languageCode );
languageCode = string.Concat( languageCode.Substring( 0, languageSubCodeIndex ), "-r", languageCode.Substring( languageSubCodeIndex + 1 ) );
Debug.LogWarning( "(LocalizedAppTitle) Converted " + LocalizedData[i].LanguageCode + " to " + languageCode );
}

if( !processedLanguages.Add( languageCode ) )
Expand Down
2 changes: 1 addition & 1 deletion Plugins/LocalizedAppTitle/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= Localized App Title for Android & iOS =
= Localized App Title for Android & iOS (v1.0.1) =

Online documentation available at: https://github.com/yasirkula/UnityMobileLocalizedAppTitle
E-mail: yasirkula@gmail.com
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.yasirkula.localizedapptitle",
"displayName": "Localized App Title",
"version": "1.0.0",
"version": "1.0.1",
"documentationUrl": "https://github.com/yasirkula/UnityMobileLocalizedAppTitle",
"changelogUrl": "https://github.com/yasirkula/UnityMobileLocalizedAppTitle/releases",
"licensesUrl": "https://github.com/yasirkula/UnityMobileLocalizedAppTitle/blob/master/LICENSE.txt",
Expand Down

0 comments on commit f609e8d

Please sign in to comment.