genielabs / HomeGenie

HomeGenie, the programmable automation intelligence
https://homegenie.it
GNU General Public License v3.0
402 stars 157 forks source link

Interface localization improvements. #53

Closed Bounz closed 9 years ago

Bounz commented 9 years ago

I've extracted a lot of hard-coded strings into locale files (issue #31). For now new strings are available for English and Russian languages. Also added device handler for Z-Wave.Me Thermostat and implemented SetPointSet in Celsius. I'll continue to work on implementing device handler because now it works very poor (doesn't show current temperature and mode).

genemars commented 9 years ago

Hey Bounz can you try to update to last commit (did few minutes ago, didn't see this before), so I can merge easily.

genemars commented 9 years ago

How did you generated locale strings? There is a function here: https://github.com/genielabs/HomeGenie/blob/master/BaseFiles/Common/html/js/api/homegenie.webapp.js#L684 that can be used for this.

Bounz commented 9 years ago

Hi, Gene. I've merged your recent changes so the pull request could be automatically merged now. About locale strings. As I see the function you told me about just displays a list of 'data-locale-id's on current page. When I translated interface I've used as much predefined 'data-locale-id's as possible, but in some cases I've to think up these IDs by myself (for example https://github.com/Bounz/HomeGenie/commit/1fd32b574b1d2ae88713d616fcf58435f6e3f1dd#diff-830dfb751f48418ae86ead8125beadcfL35).

genemars commented 9 years ago

Hey Bounz, I had to apply some corrections to the localization functions, because otherwise would have shown "null" when using GetLocaleString on an non-existent entry for other languages. Now this is fixed because it's using english locale as fallback when the string is not found. Also generated a list of currently unmapped entries: ... configure_group_newgroupconfirm configure_module_optremoveseparator configure_program_selectcommandtarget configure_program_selectcommandtoperform configure_program_commandcustomgot configure_program_wizardproceed configure_program_commandcapturetitle configure_program_waitingnewcommand configure_program_waitingnewcommandadvice configure_program_capturestop configure_program_wizard_editline_title configure_program_wizard_editline_prompt configure_program_wizard_editline_number configure_program_wizard_editline_delete configure_program_wizard_editline_change configure_program_selectconditionsubject configure_program_selectconditionproperty configure_program_conditioncapturetitle configure_program_waitingnewcondition configure_program_waitingnewconditionadvice configure_program_capturestop configure_program_wizard_editline_title configure_program_wizard_editline_prompt configure_program_wizard_editline_number configure_program_wizard_editline_delete configure_program_wizard_editline_change configure_program_options_update configure_interfaces_zwavediscovery configure_interfaces_camerasettings configure_interfaces_upnp configure_interfaces_weeco4mgpio configure_system_zwavediscoverytitle configure_system_updateinstall configure_system_deletemodule systemsettings_backuprestores1selectallnone securitysettings_password_setpassword securitysettings_password_enterpassword maintenance_configuration_servicerestart configure_maintenance_restartprompt configure_maintenance_restartwarning home_menu_events configure_module_typemediareceiver configure_module_typemediatransmitter configure_module_featuresoptions configure_programslist_tap_enable ... Once the en locale is complete, this can also be used as a base for other languages.

Bounz commented 9 years ago

Great. It's perfect that English locale is now a fallback for other locales. I'll do the mapping for these unmapped entries.

genemars commented 9 years ago

Hey Buonz hold on =) I'm doing it. You will do the russian ones once I finish this. Thanks!

genemars commented 9 years ago

These are the entries you can edit and append to ru.json:

    "configure_group_newgroupconfirm": 
        "Ok",
    "configure_module_optremoveseparator": 
        "Remove",
    "configure_program_selectcommandtarget": 
        "Select command target",
    "configure_program_selectcommandtoperform": 
        "Select command to perform",
    "configure_program_commandcustom": 
        "Custom API command",
    "configure_program_wizardproceed": 
        "Proceed",
    "configure_program_commandcapturetitle": 
        "Capturing Commands",
    "configure_program_waitingnewcommand": 
        "Waiting for new events...",
    "configure_program_waitingnewcommandadvice": 
        "",
    "configure_program_capturestop": 
        "Stop",
    "configure_program_wizard_editline_title": 
        "Edit line",
    "configure_program_wizard_editline_prompt": 
        "Move or delete line <span id=\"command_linenumber_label\" style=\"font-weight:bold\"></span>",
    "configure_program_wizard_editline_number": 
        "New line number",
    "configure_program_wizard_editline_delete": 
        "Delete",
    "configure_program_wizard_editline_change": 
        "Move",
    "configure_program_selectconditionsubject": 
        "Select condition subject",
    "configure_program_selectconditionproperty": 
        "Select comparison property",
    "configure_program_conditioncapturetitle": 
        "Capturing Conditions",
    "configure_program_waitingnewcondition": 
        "Waiting for new events...",
    "configure_program_waitingnewconditionadvice": 
        "",
    "configure_program_capturestop": 
        "Stop",
    "configure_program_wizard_editline_title": 
        "Edit Line",
    "configure_program_wizard_editline_prompt": 
        "Move or delete line <span id=\"condition_linenumber_label\" style=\"font-weight:bold\"></span>",
    "configure_program_wizard_editline_number": 
        "New line number",
    "configure_program_wizard_editline_delete": 
        "Delete",
    "configure_program_wizard_editline_change": 
        "Move",
    "configure_program_options_update": 
        "Update",
    "configure_interfaces_zwavediscovery": 
        "Discovery",
    "configure_interfaces_camerasettings": 
        "Device / Resolution / FPS",
    "configure_interfaces_upnp": 
        "Universal Plug &amp; Play",
    "configure_interfaces_weeco4mgpio": 
        "WEECOBOARD 4M GPIO",
    "configure_system_zwavediscoverytitle": 
        "ZWave Discovery",
    "configure_system_updateinstall": 
        "Update Install",
    "configure_system_deletemodule": 
        "Delete Module",
    "systemsettings_backuprestores1selectallnone": 
        "Select all / none",
    "securitysettings_password_setpassword": 
        "Set password",
    "securitysettings_password_enterpassword": 
        "Enter password for 'admin' user",
    "maintenance_configuration_servicerestart": 
        "Restart Service?",
    "configure_maintenance_restartprompt": 
        "Are you sure you want to restart service?",
    "configure_maintenance_restartwarning": 
        "",
    "configure_module_typemediareceiver": 
        "Media Receiver",
    "configure_module_typemediatransmitter": 
        "Media Transmitter",
    "configure_module_featuresoptions": 
        "Features/Options"
genemars commented 9 years ago

Also added to _programslist.js:

    "configure_program_details_implemfeatures":
        "Implemented Features",
Bounz commented 9 years ago

Ok, I'm working on Russian locale. Noticed that some keys have duplicates in list you provided:

I've removed that duplicate keys. Would you push a commit with updated en.json so I'll merge it with my repo and create a pull request with updated ru.json?

genemars commented 9 years ago

Ok, wait for my push then, if not today, it will be by tomorrow.

genemars commented 9 years ago

Pushed. Now all locale files contains all strings. So just open the ru.json and replace values that are still in english with the russian ones (you will find most of them at the bottom, but some other is sparse).

Bounz commented 9 years ago

Thank you, Gene! I've updated Russian locale and created a new pull request.