I have run lektor server locally, but the generated pages on localhost port 5000 have extraneous text stating Project-Id-Version, etc. For example:
Why and how I can enable Tor Package Repository in Debian?
The Tor Project maintains its own Debian package repository. Since Debian provides the LTS version of Tor, this might not always give you the latest stable Tor version. Therefore, it's recommended to install tor from our repository. Project-Id-Version: PACKAGE VERSION Report-Msgid-Bugs-To: PO-Revision-Date: 2021-08-23 16:19+PST Last-Translator: Automatically generated Language-Team: none Language: en MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1);
Here's how you can enable Tor Package Repository in Debian based distributions: Project-Id-Version: PACKAGE VERSION Report-Msgid-Bugs-To: PO-Revision-Date: 2021-08-23 16:19+PST Last-Translator: Automatically generated Language-Team: none Language: en MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1);
How can I fix this?
Sent with ProtonMail Secure Email.
Derek Cameron:
I have run lektor server locally, but the generated pages on localhost port 5000 have extraneous text stating Project-Id-Version, etc. For example: Project-Id-Version: PACKAGE VERSION Report-Msgid-Bugs-To: PO-Revision-Date: 2021-08-23 16:19+PST Last-Translator: Automatically generated Language-Team: none Language: en MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1);
How can I fix this?
I have seen other people having this issue, I am not sure why it happens.
That text is the start of the translation files on the 'i18n' folder, so maybe some part of the i18n plugin is not working well.
What is your operating system?
emmapeel
I am running Ubuntu 21.04 on my workstation.
On rerunning, I can now view the page clearly. Here is the procedure that worked for me, combining instructions from three sources:
- https://gitlab.torproject.org/tpo/web/tpo/-/wikis/Compiling-a-local-version-... - https://gitlab.torproject.org/tpo/web/tpo - https://championquizzer.gitlab.io/blog/2021/04-13-first-contributions.html
I have noted some errors and some modifications I made to the process to get most of it to work. Right now, lektor build still gives errors, though the page does display okay.
1. Install Lektor =================
The lektor install script https://www.getlektor.com/install.sh broke with an error about a missing file. From https://github.com/lektor/lektor/issues/619 I learned that others have experienced this same error. I followed the solution from a comment in that issue:
"You should be able to install it by downloading the suggested fixed script from https://raw.githubusercontent.com/lektor/lektor/5f2c070f6c89df5fbfb6cdf8c539... and then run it using Python."
2. Install the dependencies for the lektor-i18n-plugin ======================================================
sudo apt-get install gettext python3-babel
pip install babel
The first time I went throught this process, I got an error ValueError: Unknown extraction method 'jinja2'. Therefore when I repeated this process I added a new dependency:
sudo pip install jinja2
3. On GitHub, fork https://github.com/torproject/support ========================================================
My fork is named https://github.com/dcamepm/support
4. Clone locally ================
mkdir ~/GitHub
cd ~/GitHub
(I had previously installed and configured git.)
git clone https://github.com/dcamepm/support.git
cd support
git remote add upstream https://github.com/torproject/support.git
5. Add a new branch for eventual changes ========================================
git checkout -b replace-apt-key
git branch
6. Clone translations repository ================================
The instruction "git clone https://git.torproject.org/translation.git i18n" gave an error "fatal: destination path 'i18n' already exists and is not an empty directory." Therefore I did:
cd i18n
git clone https://git.torproject.org/translation.git
cd ../lego && git submodule update --init --recursive
7. Install the rest of the plugins ==================================
lektor plugins reinstall
8. View page before making any changes ======================================
To save some time while building locally, edit the ~/GitHub/support/configs/i18n.ini file and take some languages out of the translations option.
vi ~/GitHub/support/configs/i18n.ini
I left "es" as the only translation option.
Then, while still in the lego directory:
lektor build
N.B. The lektor build command produces several errors:
"FileNotFoundError: [Errno 2] No such file or directory: 'babel.cfg'"
"Finished build in 422.10 sec"
"FileNotFoundError: [Errno 2] No such file or directory: 'i18n'"
lektor server
9. Planned changes not done yet ===============================
Make changes to the page.
cd ~/GitHub/support
vi content/apt/apt-1/contents.lr
Commit locally:
git add content/apt/apt-1/contents.lr
git commit -m "Replace deprecated apt-key command"
Push branch "replace-apt-key" to GitHub:
git push -u origin replace-apt-key
Expect something like "Compare and Make a Pull Request" on the GitHub interface.
Sent with ProtonMail Secure Email.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, August 24th, 2021 at 12:32 AM, emma peel emma.peel@riseup.net wrote:
I have seen other people having this issue, I am not sure why it happens.
That text is the start of the translation files on the 'i18n' folder, so maybe some part of the i18n plugin is not working well.
What is your operating system?
emmapeel
Thanks for the detailed report!
I have opened https://gitlab.torproject.org/tpo/web/team/-/issues/11 to update the docs with all the useful information you gathered.
I answer some questions inline:
Derek Cameron:
sudo pip install jinja2
I think this dependency is also necessary for lektor, not only the i18n plugin.
Then, while still in the lego directory:
lektor build
N.B. The lektor build command produces several errors:
"FileNotFoundError: [Errno 2] No such file or directory: 'babel.cfg'"
"Finished build in 422.10 sec"
"FileNotFoundError: [Errno 2] No such file or directory: 'i18n'"
lektor server
This commands need to be run on the root directory, not the lego one.
Did you manage to build and see your changes?
Expect something like "Compare and Make a Pull Request" on the GitHub interface.
I don't understand. Do you mean that you didn't got offered to make a Pull Request?
Hmm. I am not sure why not. Maybe something about the fork?
On Tuesday, August 24th, 2021 at 10:09 AM, emma peel emma.peel@riseup.net wrote:
lektor server
This commands need to be run on the root directory, not the lego one.
Did you manage to build and see your changes?
Yes! That works now. Many thanks for your help.
Expect something like "Compare and Make a Pull Request" on the GitHub interface.
I don't understand. Do you mean that you didn't got offered to make a Pull Request?
Hmm. I am not sure why not. Maybe something about the fork?
Right now I am as far as step 8 of my workflow, "View page before making any changes." I'll take a look at this once I get on to step 9, "Planned changes not done yet."
tor-community-team@lists.torproject.org