use sentence case for android to desktop translation morphing

pull/1320/head
Audric Ackermann 5 years ago
parent fd30e76d95
commit 68c1f1f781
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -32,7 +32,7 @@
"description": "The label that is used for the View menu in the program main menu. The '&' indicates that the following letter will be used as the keyboard 'shortcut letter' for accessing the menu with the Alt-<letter> combination.",
"androidKey": "message_recipients_list_item__view",
"addStart": "&",
"wordCapitalize": true
"sentenceCase": true
},
"mainMenuWindow": {
"message": "&Window",
@ -64,7 +64,7 @@
"message": "Undo",
"description": "Edit menu command to remove recently-typed text",
"androidKey": "ConversationListFragment_undo",
"wordCapitalize": true
"sentenceCase": true
},
"editMenuRedo": {
"message": "Redo",
@ -93,10 +93,10 @@
"androidKey": "delete"
},
"editMenuSelectAll": {
"message": "Select All",
"message": "Select all",
"description": "Edit menu comand to select all of the text in selected text box",
"androidKey": "conversation_list_batch__menu_select_all",
"wordCapitalize": true
"sentenceCase": true
},
"editMenuStartSpeaking": {
"message": "Start speaking",
@ -233,7 +233,7 @@
"message": "View",
"description": "Used as a label on a button allowing user to see more information",
"androidKey": "message_recipients_list_item__view",
"wordCapitalize": true
"sentenceCase": true
},
"youLeftTheGroup": {
"message": "You have left the group.",
@ -520,16 +520,19 @@
"androidKey": "BucketedThreadMedia_Yesterday"
},
"thisWeek": {
"message": "This Week",
"message": "This week",
"description": "Section header in the media gallery",
"androidKey": "BucketedThreadMedia_This_week",
"wordCapitalize": true
"ignoreCase": true,
"sentenceCase": true
},
"thisMonth": {
"message": "This Month",
"description": "Section header in the media gallery",
"androidKey": "BucketedThreadMedia_This_month",
"wordCapitalize": true
"ignoreCase": true,
"sentenceCase": true
},
"voiceMessage": {
"message": "Voice Message",
@ -871,7 +874,8 @@
"unpairDevice": {
"message": "Unlink Device",
"androidKey": "fragment_device_list_unlink_device_title",
"wordCapitalize": true
"ignoreCase": true,
"sentenceCase": true
},
"unpairDeviceWarning": {
"message": "Are you sure you want to unlink this device?",

@ -72,7 +72,7 @@
"description": "Edit menu command to remove the selected text"
},
"editMenuSelectAll": {
"message": "Tout Sélectionner",
"message": "Tout sélectionner",
"description": "Edit menu comand to select all of the text in selected text box"
},
"editMenuStartSpeaking": {
@ -414,11 +414,11 @@
"description": "Section header in the media gallery"
},
"thisWeek": {
"message": "Cette Semaine",
"message": "Cette semaine",
"description": "Section header in the media gallery"
},
"thisMonth": {
"message": "Ce Mois",
"message": "Ce mois",
"description": "Section header in the media gallery"
},
"voiceMessage": {

@ -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', 'ignoreCase']
ALLOWED_ITEM_KEYS = ['message', 'description', 'comment', 'placeholders', 'androidKey', 'androidKeyCount', 'androidReplace', 'addStart', 'ignoreCase', 'sentenceCase']
SPECIFIC_LOCALES_MAPPING = {
'zh_CN': 'zh-rCN',
@ -106,8 +107,8 @@ def validateKeysPresent(items):
def morphToDesktopSyntax(androidString, desktopItem):
replaced = androidString.replace(r"\'", "'")
if('wordCapitalize' in desktopItem.keys() and desktopItem['wordCapitalize']):
replaced = replaced.title()
if('sentenceCase' in desktopItem.keys() and desktopItem['sentenceCase']):
replaced = replaced.capitalize()
if ('androidReplace' in desktopItem.keys()):
for key, value in desktopItem['androidReplace'].items():

Loading…
Cancel
Save