LEARN A NEW SKILL: contribute to open source software by translating the app Power By The Hour

The app Power By The Hour has become very popular over the last year. Maybe due to the energy (pricing) crisis. I would never had thought that this app, which was born out of my own frustration and originally created as quick and dirty as possible, would have thousands of users now.

Anyhow, I think it is time to have the app translated to all possible Homey languages.

Danish (da): Done by @Yestond
German (de): Done by @DirkG
English (en): Done
Spanish (es): Volunteer needed!
French (fr): Done by @sebyldino
Italian (it): Done by @Alessandro_Rossi
Dutch (nl): Done
Norwegian (no): Done by @Kai_Engvik
Polish (pl): In the works by @Jacek
Russian (ru): Volunteer needed!
Swedish (sv): Done by @Teddy

So if you want to immortalize your name as contributor to this app let me know as a reply to this topic.

Basically anyone that can translate and has basic PC skills can do the translation. You definitely do not need to be a programmer or tech wizzard! I created a how-to below. Just follow that and you will have learnt how to contribute to a an open source software development. You can use your newly acquired digital skill on your resume :wink:.

4 Likes

How to translate:

  1. create a github account if you don’t already have one: https://github.com

  2. Open the PBTH source page: GitHub - gruijter/com.gruijter.powerhour: Homey app to summarize power meters per hour, day and month

  3. Click on ‘create fork’. This will make a copy of all the source code in your own account

  4. go to your own copy (fork): https://github.com/YOURNAME/com.gruijter.powerhour
    4a) If it has been a while since you created the fork, or you are redoing translations, make sure you have the latest copy of the master. There should be 0 commits behind gruijter:master

  5. when your own copy has opened in Github press the decimal point . on your keyboard. This will open an online editor.

  6. right-click on the file README.txt and copy it in the same place. Rename it to README.xx.txt where xx is the 2-letter language abbreviation (e.g. no for Norwegian)

  7. edit the content and replace it with the translated text. Note there is no need to click on a save button.

  8. open the folder .homeycompose and edit the file app.json. IMPORTANT: MAKE SURE TO EDIT FROM THE .homeycompose FOLDER. The file app.json also exists in the root folder, but besides readme.xx.txt all language files MUST be edited from the .homecompose folder or from a xxx.compose.json file!

  9. in app.json copy the full line with English description, including the comma on the end, and insert it before the “nl” line:
    "en": "Summarize the energy/water usage or (solar) production per hour, day, month and year. Use dynamic tariffs.",
    Now replace “en” with the new language code, and replace the text with the translated version. IMPORTANT: YOU SHOULD NOT SEE RED CURLY LINES. If you do something is wrong (like a missing or misplaced comma)

  10. open the .homeycompose\capabilities folder. Open each file and repeat step 9) for the title in each file.

  11. open the .homeycompose\flows folder. Open each individual file and repeat step 9) for all places where there is an "en" text line.

  12. open the drivers folder and find the file driver.compose.json in each of the drivers. There are 4 drivers, so step 9) has to be performed for all 4 files.

  13. Check that you have translated all these files:

  • README.xx.txt in the root folder
  • app.json in folder .homeycompose
  • all files in folder .homeycompose\capabilities
  • all files in folder .homeycompose\flows
  • all files named driver.compose.json under the folder driver
  1. you can add your own name in the "translators" section of .homeycompose\app.json. Copy the full GB section before the NL section: { "name": "🇬🇧 Robin" },
    off course replacing Robin with your own name, thereby making yourself immortal in PBTH :partying_face:

  2. Check in the bottom left that the error count is at 0. If not: fix the problems :slight_smile:
    2022-07-12 (3)

  3. Now commit (save) the changes by clicking on the source-control icon. Enter a description, e.g. Norwegian translation and click on the commit-and-push checkmark.
    2022-07-12 (4)

  4. Finally make sure that the changes you made in your own copy (fork) gets uploaded to the main code. Open the github page https://github.com/YOURNAME/com.gruijter.powerhour (back in browser) and click on Contribute - Open Pull Request
    2022-07-12 (5)
    Then in the next screen click on Create pull request and follow the instructions.

And that is about it. I will get a message that you have created the translation, and I will integrate it in the next version of PBTH.

2 Likes

Hi @Gruijter, I could do the German translation.

1 Like

Super! Let me know if the howto I created is incorrect or incomplete.

Oops, just realized I forgot to mention some files that need a lot of translation. driver.compose.json. This file can be found under the /drivers folder. PBTH has 4 drivers, so there are 4 files to be translated.

I’ll update the howto.

1 Like

Does anyone know a German translation for the word “Summarizer”?

Zusammenfasser ?

Hm, I don’t like it that much.
If I don’t get a word suggested, I’ll leave it at “Summarizer”.

1 Like

Another question to all PBTH user.
What does “Bidding zone” resp. “Biedzone” mean?

Info: I don’t use PBTH myself yet, so it’s sometimes a bit difficult to understand some terms.

I can do the swedish translation for you. Have a couple under my belt already so one more app aint a huge problem :wink:

1 Like

I can help with Italian translation. :it:
Is it necessary to have programming skills, or is it enough to be an “average user” with a Github account? :sweat_smile:

1 Like

It is related to the market where energy is sold. Usually each country has one or a few bidding zones.

1 Like

Super! I will add you to the list Ted!

No, see the first post. You only need basic PC skills. Just follow the how to.

Thx for translating Alessandro! I’ll put you on the list as well.

1 Like

@Gruijter : Have a question for you … do you want us to set the unit for the money capability translation in my case to Kr = Swedish kronor … I know you have the option in the settings for setting it individually … But do you want us to put in the default value for the country?

No, just leave it empty. Im removing the euro sign also.

ok, Will do! Would have saved many swedes to change it to Kr for every device. But anyway … ill leave it be for now.

You have a pull request on Github now Robin for the Swedish translation :wink:

1 Like

Nice work @Teddy and @DirkG . The Swedish and German translations are now merged in the main code. I will wait for the others a bit to finish too before releasing it in the app store.

2 Likes

Going to go over the translation one more time tomorrow for swedish. Just incase i had a brainfart going when i was translating it :wink: Cant hurt with a second go over. It should be ok but i am a litle paranoid that someone will some later on and tell me… Emm Ted how the … did you think there.

1 Like