@ -7,11 +7,12 @@ import traceback
# androidKey
# "androidKeyCount": "one" or "other" used to find matching key with quantity
# "wordCapitalize": true capitalize each words (must be called before addStart)
# "sentenceCase": true capitalize first word (must be called before addStart)
# "ignoreCase": true ignore case difference between android EN and desktop EN values (some stuff are put in maj on android but not on desktop)
# "addStart": "&" char to add as start char
# "androidReplace": replace all occurences of key value pair
ALLOWED_ITEM_KEYS = [ ' message ' , ' description ' , ' comment ' , ' placeholders ' , ' androidKey ' , ' wordCapitalize' , ' androidKeyCount' , ' androidReplace ' , ' addStart ' , ' ignor eCase' ]
ALLOWED_ITEM_KEYS = [ ' message ' , ' description ' , ' comment ' , ' placeholders ' , ' androidKey ' , ' androidKeyCount' , ' androidReplace ' , ' addStart ' , ' ignor eCase' , ' sentenc eCase' ]
SPECIFIC_LOCALES_MAPPING = {
' zh_CN ' : ' zh-rCN ' ,
@ -106,8 +107,8 @@ def validateKeysPresent(items):
def morphToDesktopSyntax ( androidString , desktopItem ) :
replaced = androidString . replace ( r " \ ' " , " ' " )
if ( ' wordCapitaliz e' in desktopItem . keys ( ) and desktopItem [ ' wordCapitaliz e' ] ) :
replaced = replaced . titl e( )
if ( ' sentenceCas e' in desktopItem . keys ( ) and desktopItem [ ' sentenceCas e' ] ) :
replaced = replaced . capitaliz e( )
if ( ' androidReplace ' in desktopItem . keys ( ) ) :
for key , value in desktopItem [ ' androidReplace ' ] . items ( ) :