Merged lang rename
7
Makefile
|
@ -1,7 +1,8 @@
|
|||
LANG ?= en-GB
|
||||
LANG ?= en
|
||||
|
||||
LANG := $(subst .UTF-8,,$(LANG))
|
||||
LANG := $(subst _,-,$(LANG))
|
||||
LANG := $(subst -, ,$(LANG))
|
||||
LANG := $(subst _, ,$(LANG))
|
||||
LANG := $(firstword $(LANG))
|
||||
|
||||
all:
|
||||
./generate-html.py $(LANG)
|
||||
|
|
12
README.md
|
@ -30,17 +30,15 @@ Current known contributors are:
|
|||
* it-IT - @LizardM4
|
||||
* tr-TR - @Ardakilic
|
||||
|
||||
We are looking for additional contributors to cater for languages not yet in our repository. If you wish to help translate into a new language:
|
||||
You should start by duplicating the `src/en` directory to the
|
||||
appropriate culture. For example if you want to create a German translation you would create the folder `src/de`.
|
||||
|
||||
You should start by duplicating the `src/en-GB` directory to the
|
||||
appropriate culture. For example if you want to create a German translation you would create the folder `src/de-DE`.
|
||||
|
||||
At the moment cultures are not fully supported, so you can't have `src/fr-CA` ( sorry! ), and there are no plans for this.
|
||||
There are no plans to support cultures, so you can't have `src/fr-CA` ( sorry! ).
|
||||
|
||||
Once you've made your translation, build and preview it with, for example:
|
||||
|
||||
```bash
|
||||
make serve LANG=de-DE
|
||||
make serve LANG=de
|
||||
```
|
||||
|
||||
And then open: http://127.0.0.1:5000 in your browser.
|
||||
|
@ -58,4 +56,4 @@ Submit your finished translation as a pull request and I'll get it live on pinou
|
|||
* Allow for slightly longer descriptions of Pin functions ( baloons? ), current width is very restrictive
|
||||
* Does X board work with Y board
|
||||
* What extra functions does this pin have ( mostly done with ALT functions tables, but needs descriptions )
|
||||
* Tool to convert WiringPi to GPIO to BCM and back
|
||||
* Tool to convert WiringPi to GPIO to BCM and back
|
||||
|
|
|
@ -328,7 +328,7 @@ Main Program Flow
|
|||
'''
|
||||
|
||||
|
||||
lang = "en-GB"
|
||||
lang = "en"
|
||||
default_strings = {
|
||||
'made_by': '* Made by {manufacturer}',
|
||||
'type_hat': '* HAT form-factor',
|
||||
|
@ -469,7 +469,8 @@ for url in pages:
|
|||
overlays = overlays_html,
|
||||
resource_url = resource_url,
|
||||
description = pages[url]['description'],
|
||||
title = pages[url]['name']
|
||||
title = pages[url]['name'],
|
||||
langcode = lang
|
||||
)
|
||||
print('Outputting page {}'.format(url))
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import markjaml
|
|||
reload(sys)
|
||||
sys.setdefaultencoding('utf8')
|
||||
|
||||
lang = "en-GB"
|
||||
lang = "en"
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
lang = sys.argv[1]
|
||||
|
|
|
@ -53,7 +53,7 @@ def physical_to(pin, scheme='bcm'):
|
|||
return pin
|
||||
return None
|
||||
|
||||
def load(lang='en-GB'):
|
||||
def load(lang='en'):
|
||||
global pins, settings
|
||||
if DB_FILE.endswith('.yaml'):
|
||||
db = yaml.load(open('src/{}/{}'.format(lang,DB_FILE)).read())
|
||||
|
|
Before Width: | Height: | Size: 545 B After Width: | Height: | Size: 545 B |
Before Width: | Height: | Size: 599 B After Width: | Height: | Size: 599 B |
Before Width: | Height: | Size: 469 B After Width: | Height: | Size: 469 B |
Before Width: | Height: | Size: 545 B After Width: | Height: | Size: 545 B |
Before Width: | Height: | Size: 420 B After Width: | Height: | Size: 420 B |
Before Width: | Height: | Size: 492 B After Width: | Height: | Size: 492 B |
2
serve.py
|
@ -3,7 +3,7 @@ from flask import Flask, send_from_directory
|
|||
import sys
|
||||
app = Flask(__name__)
|
||||
|
||||
lang = 'en-GB'
|
||||
lang = 'en'
|
||||
|
||||
@app.route('/')
|
||||
def show_index():
|
||||
|
|