formatting

lektura
max.mehl 2017-09-07 23:08:56 +02:00
parent 4008090cc8
commit 424d90b40f
2 changed files with 124 additions and 43 deletions

View File

@ -2,27 +2,41 @@
[![Build Status](https://drone.fsfe.org/api/badges/pmpc/website/status.svg)](https://drone.fsfe.org/pmpc/website)
This website is the core of the "Public Money, Public Code" campaign. It is based on [Hugo](https://gohugo.io/), a modern static website generator.
This website is the core of the "Public Money, Public Code" campaign. It is
based on [Hugo](https://gohugo.io/), a modern static website generator.
The page is visible at [publiccode.eu](https://publiccode.eu). Please do not spread this URL. The website requires authentication to be visited. Username is `pmpc`, password is `publicmoneypubliccode`. Please do not spread this information to outside people not involved in the website development.
The page is visible at [publiccode.eu](https://publiccode.eu). Please do not
spread this URL. The website requires authentication to be visited. Username is
`pmpc`, password is `publicmoneypubliccode`. Please do not spread this
information to outside people not involved in the website development.
## Contributing to the website
### Prerequisites
In order to modify the website, you need `hugo` and `git` installed on your computer. If Hugo isn't available in your package manager, obtain it from its [official website](https://gohugo.io). We tested the website build with Hugo from version 0.20.7 upwards. Please make sure that you use an as recent version as possible to avoid errors.
In order to modify the website, you need `hugo` and `git` installed on your
computer. If Hugo isn't available in your package manager, obtain it from its
[official website](https://gohugo.io). We tested the website build with Hugo
from version 0.20.7 upwards. Please make sure that you use an as recent version
as possible to avoid errors.
### Configuring Git
First of all, you'll need an account on git.fsfe.org. With an FSFE account (FSFE Fellowship/supporter/volunteer) you can simply login with your normal username and password. If you don't have an FSFE account yet, please contact Erik, Jonas or Max about it. Without an account, you can download this repository but you won't be able to push modifications to this repository.
First of all, you'll need an account on git.fsfe.org. In the FSFE's wiki,
you'll find [information about our Git
service](https://wiki.fsfe.org/TechDocs/Git), how to get access, and some
guides for basic procedures like configuration, commits, and pushes.
As part of the campaign team you can get full write access to this repository. Please contact one of [pmpc](https://git.fsfe.org/pmpc)'s admins to give your account the necessary privileges.
In the FSFE's wiki, you'll find [information about our Git server](https://wiki.fsfe.org/TechDocs/Git) installation, and some guides for basic procedures like configuration, commits, and pushes.
As part of the campaign team you can get full write access to this repository.
Please contact one of [pmpc](https://git.fsfe.org/pmpc)'s admins to give your
account the necessary privileges.
### Cloning the website
Although the mentioned Git guides will enable you to understand how to download the website's repository, here's a short howto: Navigate to a directory on your computer where you want the PMPC website to be stored. In this example, it's `FSFE/PMPC/website` in your user's directory.
Although the mentioned Git guides will enable you to understand how to download
the website's repository, here's a short howto: Navigate to a directory on your
computer where you want the PMPC website to be stored. In this example, it's
`FSFE/PMPC/website` in your user's directory.
```sh
mkdir -p ~/FSFE/PMPC/ # Create the directory if it doesn't exist yet
@ -30,46 +44,76 @@ cd ~/FSFE/PMPC/ # go to the newly created PMPC d
git clone git@git.fsfe.org:pmpc/website.git # clone the website to the folder website
```
In the newly created folder `pmpc-website` you'll find all source files the website consists of now. The hugo files are located under `site/`, whereas in the root directory you'll only find files informational files and those relevant for our build process (Drone, Ansible, Docker, Apache).
In the newly created folder `pmpc-website` you'll find all source files the
website consists of now. The hugo files are located under `site/`, whereas in
the root directory you'll only find files informational files and those
relevant for our build process (Drone, Ansible, Docker, Apache).
### Translate
Visit [TRANSLATE.md](https://git.fsfe.org/pmpc/website/src/master/TRANSLATE.md) for detailed instructions how to translate publiccode.eu.
Visit [TRANSLATE.md](https://git.fsfe.org/pmpc/website/src/master/TRANSLATE.md)
for detailed instructions how to translate publiccode.eu.
### Build locally
To see a preview of the website you need to have Hugo installed and be able to execute Bash scripts in your command line.
To see a preview of the website you need to have Hugo installed and be able to
execute Bash scripts in your command line.
1. Navigate to the website's root directory (in the last example `~/FSFE/PMPC/website/`) and open a terminal window there. Type in `git pull`. This will get the latest changes from the server
2. In the terminal, execute `cd site/` to navigate in the right directory for hugo's website build. You are now in `~/FSFE/PMPC/website/site/`
3. In your terminal, execute `./build/build.sh server`. This command will build the website and enable you to browse the result on your computer only. Open [localhost:1313](localhost:1313) in your web browser to see it.
1. Navigate to the website's root directory (in the last example
`~/FSFE/PMPC/website/`) and open a terminal window there. Type in
`git pull`. This will get the latest changes from the server
2. In the terminal, execute `cd site/` to navigate in the right
directory for hugo's website build. You are now in
`~/FSFE/PMPC/website/site/`
3. In your terminal, execute `./build/build.sh server`. This command
will build the website and enable you to browse the result on your
computer only. Open [localhost:1313](localhost:1313) in your web
browser to see it.
If you want to make changes to the official website, please read [our Git guides](https://wiki.fsfe.org/TechDocs/Git). There you'll find out about the necessary commands pull, status, add, commit, or push.
If you want to make changes to the official website, please read [our
Git guides](https://wiki.fsfe.org/TechDocs/Git). There you'll find out
about the necessary commands pull, status, add, commit, or push.
Beginners can directly commit to the repository which saves them some steps, but they have to ask @max.mehl or @jonaso in advance to give them the necessary permission. For more experienced Git users we recommend the Fork & Pull Request workflow, which you'll also find in the [wiki's Git Guides section](https://wiki.fsfe.org/TechDocs/Git#Guides_on_specific_actions) (not available yet).
Beginners can directly commit to the repository which saves them some
steps, but they have to ask @max.mehl or @jonas in advance to give them
the necessary permission. For more experienced Git users we recommend
the Fork & Pull Request workflow, which you'll also find in the [wiki's
Git Guides
section](https://wiki.fsfe.org/TechDocs/Git#Guides_on_specific_actions)
(not available yet).
## Important file paths
The website structure is very easy. The most important files and directories are:
- `site/config-static.toml`: Static texts and URLs which are the same for any language
- `site/languages/strings.{en,fr...}.toml`: Headlines, site title, many texts for the various languages.
- `site/content`: Markdown-files for sub-pages like /openletter, can be translated
- `site/data/{en,de...}/share`: Services and their very short translatable strings where people can share to. Is being used in the "Spread" section and the left-side sharing icons
- `site/config-static.toml`: Static texts and URLs which are the same
for any language
- `site/languages/strings.{en,fr...}.toml`: Headlines, site title, many
texts for the various languages.
- `site/content`: Markdown-files for sub-pages like /openletter, can be
translated
- `site/data/{en,de...}/share`: Services and their very short
translatable strings where people can share to. Is being used in the
"Spread" section and the left-side sharing icons
- `site/static/`: CSS, images, and Javascript files for the design.
- `site/static/css/custom.css`: File where all custom CSS code should be written to.
- `site/layouts/`: HTML structure (scaffold) for the website. Useful if you want to add another section or modify anchor links or CSS classes.
- `site/static/css/custom.css`: File where all custom CSS code should be
written to.
- `site/layouts/`: HTML structure (scaffold) for the website. Useful if
you want to add another section or modify anchor links or CSS classes.
- `site/layouts/page`: Template for a sub-page like /privacy
- `site/layouts/shortcodes`: HTML/Hugo code which can be important from within a Markdown file
- `site/public/`: Built files which are used to display the website. Generated by running `hugo`.
- `site/layouts/shortcodes`: HTML/Hugo code which can be important from
within a Markdown file
- `site/public/`: Built files which are used to display the website.
Generated by running `hugo`.
## Technical information about the online build
The FSFE uses Drone to automatically deploy the PMPC website. The website is
automatically deployed when there's a push to the master branch of the
repository, as well as once an hour (to update signatures).
The FSFE uses Drone to automatically deploy the PMPC website. The
website is automatically deployed when there's a push to the master
branch of the repository, as well as once an hour (to update
signatures).
This is the latest build status:

View File

@ -1,10 +1,16 @@
# How to translate publiccode.eu
Translating the publiccode.eu website isn't really hard but may be a bit different from what you worked with before. Before starting, please read the [README.md](https://git.fsfe.org/pmpc/website/src/master/README.md) file which will give you an overview of how this website is structured and built.
Translating the publiccode.eu website isn't really hard but may be a bit
different from what you worked with before. Before starting, please read the
[README.md](https://git.fsfe.org/pmpc/website/src/master/README.md) file which
will give you an overview of how this website is structured and built.
## Preparations
You should already have cloned the Git repository to your computer and be familiar with working with Git. You find the necessary instructions and links to tutorials in the aforementioned README file. Don't be afraid: you don't have to be a programmer to get Git working for you :)
You should already have cloned the Git repository to your computer and be
familiar with working with Git. You find the necessary instructions and links
to tutorials in the aforementioned README file. Don't be afraid: you don't have
to be a programmer to get Git working for you :)
What you should have:
@ -16,39 +22,70 @@ What you should have:
## Translatable files
There are a few locations where you find translatable files. All of them are inside the `site/` directory
There are a few locations where you find translatable files. All of them are
inside the `site/` directory
### Content/
In `content/` are the sub-pages like [/privacy](https://publiccode.eu/privacy). All files are written in the [Markdown syntax](https://en.wikipedia.org/wiki/Markdown) which is very easy to learn and much more comfortable to write and translate than HTML.
In `content/` are the sub-pages like [/privacy](https://publiccode.eu/privacy).
All files are written in the [Markdown
syntax](https://en.wikipedia.org/wiki/Markdown) which is very easy to learn and
much more comfortable to write and translate than HTML.
In all files you'll find a *header* which starts and ends with `---` (three dashes). In this header, all you have to translate is the `title:` value which defines the title and headline of the page. The other values like `type` and `layout` stay the same over all languages.
In all files you'll find a *header* which starts and ends with `---` (three
dashes). In this header, all you have to translate is the `title:` value which
defines the title and headline of the page. The other values like `type` and
`layout` stay the same over all languages.
The majority of the file is just text with very little markdown syntax. You should keep markup like `**`, `>`, `[fs]`, or `{{< fsdefinition >}}`. For hyperlinks like `[TEXT](http://link)`, please only translate the content inside the quare brackets (TEXT), the link has to stay the same obviously.
The majority of the file is just text with very little markdown syntax. You
should keep markup like `**`, `>`, `[fs]`, or `{{< fsdefinition >}}`. For
hyperlinks like `[TEXT](http://link)`, please only translate the content inside
the quare brackets (TEXT), the link has to stay the same obviously.
### data/share/
In `data/share/en/`, `data/share/it/` and so on there are tiny *.yaml* files for each share service we're offering (e.g. GNU Social or Diaspora).
In `data/share/en/`, `data/share/it/` and so on there are tiny *.yaml* files
for each share service we're offering (e.g. GNU Social or Diaspora).
There are only a few strings to translate. `titleBefore` is the text in front of the service's name, `titleAfter` the one behind. You can fill both fields to translate it. In English, this may be *Share on XYZ*, in German it is *Auf XYZ teilen*. There's also `customText` sometimes where you can find instructions how to translate it.
There are only a few strings to translate. `titleBefore` is the text in front
of the service's name, `titleAfter` the one behind. You can fill both fields to
translate it. In English, this may be *Share on XYZ*, in German it is *Auf XYZ
teilen*. There's also `customText` sometimes where you can find instructions
how to translate it.
### languages/
Here you find one larger file for each language e.g. `strings.en.toml` for English, `strings.de.toml` for German.
Here you find one larger file for each language e.g. `strings.en.toml` for
English, `strings.de.toml` for German.
If your language isn't present, copy the file `strings.XY.toml.sample` and rename it according to your two-letter language code. Then open it and translate all strings you find (there are only a few marked which you cannot translate).
If your language isn't present, copy the file `strings.XY.toml.sample` and
rename it according to your two-letter language code. Then open it and
translate all strings you find (there are only a few marked which you cannot
translate).
Some strings contain the Markdown links you already know (`[TEXT](LINK)`). Again, please just translate the TEXT part, not the LINK.
Some strings contain the Markdown links you already know (`[TEXT](LINK)`).
Again, please just translate the TEXT part, not the LINK.
At some occasions you'll find a variable like `$INDS`. Leave them as is, they will automatically replaced by numbers or similar auto-generated content.
At some occasions you'll find a variable like `$INDS`. Leave them as is, they
will automatically replaced by numbers or similar auto-generated content.
Regarding the campaign name *Public Money, Public Code*. In the past we haven't made good experiences with translating such campaign names. All our graphics, logos, and other communication is using this brand. So if you can, just stick to the English term.
Regarding the campaign name *Public Money, Public Code*. In the past we haven't
made good experiences with translating such campaign names. All our graphics,
logos, and other communication is using this brand. So if you can, just stick
to the English term.
## Finished? What's next
Before submitting the translations you can test them locally if you have Hugo installed and are able to execute Bash scripts on your command line. Please refer to README.me for instructions.
Before submitting the translations you can test them locally if you have Hugo
installed and are able to execute Bash scripts on your command line. Please
refer to README.me for instructions.
You're welcome to work with the Git repository to upload your translations. If you feel confident enough with Git, please open a pull request of a separate branch in this repository or your fork. @max.mehl can help you if you have questions or lack permissions.
You're welcome to work with the Git repository to upload your translations. If
you feel confident enough with Git, please open a pull request of a separate
branch in this repository or your fork. @max.mehl can help you if you have
questions or lack permissions.
If you are unsure, you can also send the translations to [FSFE's translators list](https://lists.fsfe.org/mailman/listinfo/translators) to let them proofread by other speakers of your language.
If you are unsure, you can also send the translations to [FSFE's translators
list](https://lists.fsfe.org/mailman/listinfo/translators) to let them
proofread by other speakers of your language.