Thank you for investing your time in contributing to our project! Any contribution you make will be reflected on the next release of MeteoalarmCard.
If you spot a problem in the project or want to propose a improvement or new integration to the project. Search if an issue already exists. If a related issue doesn't exist, you can open a new issue.
If you don't have MeteoalarmCard running locally please follow this setup guide.
- Install newest LTS release of Node.js and the pnpm package manager.
- Fork this repository using Fork button. This will create a new
repository on your account named
<your username>/MeteoalarmCard - Clone this repo to wherever you want:
git clone https://github.com/<your username>/MeteoalarmCard.git
- Go into the repo folder:
cd MeteoalarmCard - Install dependencies (Node.js and pnpm are required):
pnpm install
- Run the development server in the first terminal. It's going to watch source files, recompile on changes and serve the compiled card on
http://localhost:5000.pnpm start
Now pick where you want to see the card render. Either way the dev server rebuilds on save, so you refresh the browser tab to pick up your changes.
Spins up a preconfigured instance of Home Assistant with the bundled integrations and a development dashboard. The integrations pull live data, so most cards show No active warnings unless there is real weather somewhere. Every pnpm run dev starts from scratch, so anything you change in the Home Assistant UI is gone on the next run.
- Install Docker with the Compose plugin.
- Run the Docker containers. The first boot may take a couple of minutes, it will download ~2 GB of images and needs internet access.
pnpm run dev
- Open http://localhost:8123. You should auto-login to the preconfigured Home Assistant instance. Open MeteoalarmCard in the sidebar.
Commands:
pnpm run dev:downstops the instance and deleteshass-dev/config
Use this if you already run Home Assistant and want the card next to your real entities.
- Add
http://localhost:5000/meteoalarm-card.jsto your Lovelace Resources as a JavaScript Module. - Add a Meteoalarm Card to any dashboard.
Your browser is what loads the file, so this works as long as you browse Home Assistant from the machine running pnpm start.
- Fork the project and clone it to your local machine. Follow the setup guide.
- Before making any changes pull from the remote repository to update your main branch
git pull upstream master
- Create a branch on which you will be working.
git checkout -b update-polish-translation
- Commit your changes and push it to your fork of the repository.
- Make sure your changes are working locally. Run
pnpm run lintto check code style,pnpm testto run the tests andpnpm run buildto build the card. - Create a Pull Request (PR). Make sure to describe the changes that you made and use the
Fixes: #numberkeyword if you were working on a issue.
We are currently looking to implement more languages to MeteoalarmCard. If you are able to add or improve translations in language you speak don't hastate to make a PR.
Notes about current translation keys
editor.error- These keys may use the{expected_entities_count}and{selected_entities_count}placeholders, which are replaced with the number of entities the integration expects and the number you selected. Never translate a placeholder - copy it exactly, including the braces. You can leave one out if your sentence doesn't need it.editor.disable_swiper- If there is not a good translation for swiper you can keep this word untranslated.editor.description- These keys are used to generate helpful description for users selecting entities. Please make sure they sound correctly in all combinations. The formula isstart + any middle key + endeditor.description.warning_watch_statement_advisory- If there is not a good translation for words (warning, watch, statement, advisory) you can keep these words untranslated.
If you want to improve existing translation:
- Follow the setup guide and contributing guide
- Modify the language file in the
src/localize/languagesdirectory - Remember that key that are not yet translated have
nullinstead of the string. Please replace them with translated messages. - Open a Pull Request.
If you want to create a new translation:
- Follow the setup guide and contributing guide
- Copy
src/localize/languages/en.jsonfile and name it with appropriate language code. - Translate only the keys (second quotation mark).
- Import your translation in
src/localize/localize.tsfile. - Mention your translation in
README.mdfile (list should be sorted alphabetically). - Open a Pull Request.