--- tags: '@badging/i18n' --- Experimental Weblate ===================== This is where we keep our working logs and notes while preparing the locally-hosted docker-based Weblate experimental distribution. - [ ] **`Jun15`** Milestone #1 `v0.1` - [x] Create portable `npm`-style project repository - [x] Determine minimal configuration - [x] Test usage in `darwin` (Saleh) - [ ] Document usage in `darwin` (Saleh) - [x] Test usage in `WSL2` (Tola) - [ ] Document usage in `WSL2` (Tola) - [ ] Add tests for minimal configuration (Saleh & Tola) - [ ] Configure CI & GitHub actions > > Saleh's References: > > - https://github.com/nektos/act > - [ ] **`Jul01`** Milestone #2 `v0.2` - [ ] Determine integrated configuration > This should allow users to use their local weblate to translate directly against the [@badging/experimental-translation] repository - [ ] Create [@badging/experimental-translation] repository (Saleh) > This repository will use `submodules` combine sources - [ ] … --- Tola's Notes ============= Roadmap -------- - [x] Running `docker-compose` in `WSL2` > [Troubleshooting `docker-compose` in `WSL2`](https://hackmd.io/@badging/wsl2#Troubleshooting-docker-compose) - [x] Running `npm` in `WSL2` > [Troubleshooting `npm` in `WSL2`](https://hackmd.io/@badging/wsl2#Troubleshooting-npm) - [x] Running `@thecraftman/experimental-weblate` in `WSL2` - [x] Clone `~/chaoss/experimental-weblate/` > [Troubleshooting `PATH` in `WSL2`](https://hackmd.io/@badging/wsl2#Troubleshooting-PATH) - [x] Configure mailtrap.io > [mailtrap.io/inboxes/948300](https://mailtrap.io/inboxes/948300/messages) (ask Saleh for login details) ```yaml services: weblate: environment: WEBLATE_EMAIL_HOST: smtp.mailtrap.io WEBLATE_EMAIL_HOST_USER: f908d52aa00858 WEBLATE_EMAIL_HOST_PASSWORD: 41d84680a90eff WEBLATE_EMAIL_PORT: 2525 ``` - [x] Configure docker-compose.override.yml ``` version: '3' services: weblate: ports: - 80:8080 environment: # WEBLATE_EMAIL_HOST: ‹host› # WEBLATE_EMAIL_PORT: ‹port› # WEBLATE_EMAIL_HOST_USER: ‹username› # WEBLATE_EMAIL_HOST_PASSWORD: ‹password› WEBLATE_ALLOWED_HOSTS:localhost # WEBLATE_ADMIN_PASSWORD: ‹password› # WEBLATE_ADMIN_EMAIL: ‹email› ``` - [x] Run `npm run start:weblate` in terminal > You can also do this manually: > 1. `cd` into `sources/WeblateOrg/docker-compose` > 2. Run `docker-compose build` > 3. Run `docker-compose up` - [ ] Testing transltion locally on `Local Host` >1.Create new translation component on local host. > 2.Create a new projet on local host to test the workflow. **Errors ecountered while testing Weblate locally** - After adding the translation projet, specifying the soure repository was an issue i kept on getting **` Could not fetch the repository: fatal: repository not found (128)`** - Opened an issue on Weblate-docker [repo](https://github.com/WeblateOrg/docker/issues/687) - Followed the links from the issue - https://docs.weblate.org/en/latest/formats.html#adding-new-translations - https://docs.weblate.org/en/latest/admin/projects.html#adding-translation-projects-and-components - https://docs.weblate.org/en/weblate-4.0.4/vcs.html#vcs - https://docs.weblate.org/en/weblate-4.0.4/admin/projects.html#markup - After Creating a new Translation component, I specified the source code repository using `https://github.com/WeblateOrg/weblate.git` this helped fetch the translation component. - Following the Weblate [doc](https://docs.weblate.org/en/weblate-4.0.4/vcs.html#vcs) I could finally fetch the languages --- Saleh's Notes ============== Pulling from `upstream` ------------------------ 1. Locally clone your own fork: ``` git clone https://github.com/thecraftman/experimental-weblate experimental-weblate-thecraftman ``` 2. Make sure you define the `upstream` remote: ``` git remote add upstream https://github.com/SMotaal/experimental-weblate; ``` > See [GitHub: Configuring a remote for a fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/configuring-a-remote-for-a-fork) And then pull: ``` git fetch upstream; ``` > See [GitHub: Syncing a fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork) 3. Create a `staging` or `develop` branch pointing to `upstream/master`: ``` git checkout -b staging upstream/master ``` --- Matt's Notes ============= Using `virtualenv` ------------------- Create the venv and fix permissions: ``` sudo virtualenv --python=python3 ~/weblate-env sudo chown -R {YOUR USERNAME}:{YOUR USERNAME} /home/{YOUR USERNAME}/weblate-env-2 ``` Activate, or step into, the virtual environment: ``` Source ~/weblate-env/bin/activate ``` Deactivate, or step out of, the virtual environment: ``` deactivate ``` Using `pip` ------------ Used for python packages, similar to `apt-get` Install a package: ``` pip install {NAME} ``` Don't use sudo in pip when in a virtual environment! If you get `permission denied` as an error, you have to perform the permission fix for your venv again: (duplicate) ``` sudo chown -R {YOUR USERNAME}:{YOUR USERNAME} /home/{YOUR USERNAME}/weblate-env-2 ``` If you get errors like `package not found` or `dependency error`, there is likely something wrong with the package, but try several different install options to ensure it is not on your side. ``` Can't rollback pygobject, nothing uninstalled. Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ee9tupqm/pygobject/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-kx_x4zzd-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ee9tupqm/pygobject/ ``` Using `apt-get` ---------------- If you get an error that says `package not found`, try installing it with `sudo apt-get` Sometimes it's worth googling the error; sometimes the package name is different <!-- LINKS --> [@SMotaal]: https://github.com/SMotaal [@nebrethar]: https://github.com/nebrethar [@bistaastha]: https://github.com/bistaastha [@thecraftman]: https://github.com/thecraftman [@nodesource/distributions/deb/]: https://github.com/nodesource/distributions/tree/master/deb [@badging/experimental-translation]: https://github.com/badging/experimental-translation <style> div.columns {display:block;height:15vh;overflow-x:scroll;columns:25rem;padding:1em;text-align:left;} div.small{font-size:10pt;} div.columns>:first-child{margin-block-start:0;} div.columns>:last-child{margin-block-end:0;} div.scrolling{height:25vh;overflow-y:scroll;} details:not(:empty){padding-inline-start:1em;} details>summary:first-child:not(:empty){display:list-item;margin-inline-start:-1em;} details>summary:first-child>:not(:empty):first-child:last-child{display:contents;} details>summary:first-child>:not(:empty):first-child:last-child:hover > a > span:first-child:last-child:empty::before{vertical-align: 0.25em;} </style>