Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #7 from FoldingCommunity/master
Browse files Browse the repository at this point in the history
Update of head repository
  • Loading branch information
tematim authored Jun 23, 2020
2 parents 09f53b2 + bbb1b5c commit 0a4f5d0
Show file tree
Hide file tree
Showing 23 changed files with 156 additions and 80 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
11 changes: 0 additions & 11 deletions .github/workflows/lint.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Validate translation files
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyyaml
- name: Validate
run: ./validate_yaml.py
13 changes: 0 additions & 13 deletions .yamllint

This file was deleted.

5 changes: 1 addition & 4 deletions Localization/de-DE/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

5 changes: 1 addition & 4 deletions Localization/en-US/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

11 changes: 11 additions & 0 deletions Localization/en-US/faq.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
url: "https://foldingathome.org/support/faq/"
language: "en-US"
title: "FAQ"
text: [
# Bold paragraph
"You’ll find a large library of frequently asked questions about all things connected to Folding@home.",

# The rest of the paragraph
"This section contains everything from guides and information about how to install and use the Folding@home software to the science behind our research. Look through the sidebar and find the topic you want to know more about."
]
1 change: 1 addition & 0 deletions Localization/en-US/home.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
url: "https://foldingathome.org/"
title: "Folding@home"
language: "en-US"
text: [
# I AM One IN A MILLION bold text
Expand Down
5 changes: 1 addition & 4 deletions Localization/es-ES/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

5 changes: 1 addition & 4 deletions Localization/fr-FR/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

7 changes: 3 additions & 4 deletions Localization/fr-FR/about.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
url: "https://foldingathome.org/about/"
language: "fr-FR"
title: "A propos"
title: "À propos"
text: [
# Bold text at the start
"Folding @ home (FAH or F @ h)",
"Folding@home (FAH ou F@H)",

# The rest of the paragraph
# "is a distributed computing project for simulating protein dynamics, including the process of protein folding and the movements of proteins implicated in a variety of diseases. It brings together citizen scientists who volunteer to run simulations of protein dynamics on their personal computers. Insights from this data are helping scientists to better understand biology, and providing new opportunities for developing therapeutics. "
"Folding@home (FAH ou F@h) est un projet de calcul distribué qui simule des protéines dynamiques, incluant le processus de repliement de protéines ainsi que le mouvement de protéines impliquées dans de nombreuses maladies. Ce projet rassemble des citoyens scientifiques bénévoles qui exécute des simulations de protéines dynamiques sur leurs ordinateurs personnels. Les perspectives de ces données sont d'aider les scientifiques à mieux comprendre la biologie et de leur donner des opportunités de développer des nouveaux traitements."
"est un projet de calcul distribué qui simule la dynamique des protéines, y compris leur processus de repliement et leurs mouvements, des phénomènes impliqués dans de nombreuses maladies. Ce projet réunit des « citoyens scientifiques » bénévoles qui exécutent de telles simulations sur leur ordinateur personnel. Les enseignements ainsi obtenus aident les scientifiques à mieux comprendre la biologie en présence et leur permettent de développer de nouveaux traitements."
]
45 changes: 45 additions & 0 deletions Localization/fr-FR/statistics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
url: "https://foldingathome.org/statistics/"
language: "fr-FR"
title: "STATISTIQUES"
text: [
# First two paragraphs
# "One of the best ways to help Folding@home is by recruiting your friends and family. Start by sharing our project with them. Then join a team or even start your own team. The more points your team earns, the closer we come to finding cures.
# On this page you will find access to statistics for individuals and teams who have joined together to earn points and compete with other teams. Some of us are quite intense in our approach to folding. We have team websites, we supe up our computers, and we drive the technology forward by reporting bugs and making suggestions about how to improve the software.",
"Un des meilleurs moyens d'aider Folding@home est d'inviter vos amis et votre famille. Commencez par partager notre projet avec eux. Puis rejoignez une équipe ou créez la vôtre. Plus votre équipe gagne de points, plus nous avons de chances de trouver des remèdes.
Sur cette page, vous allez avoir accès aux statistiques par participant et par équipe, lesquelles rivalisent avec les autres équipes. Certains parmi nous sont des passionnés. Nous avons des sites d'équipes, nous vitaminons nos ordinateurs, et nous faisons progresser le projet en signalant les problèmes rencontrés et en suggérarnt des améliorations.",

# Maximise your effort stylistic bold text
# "MAXIMIZE your EFFORT",
"MAXIMISEZ votre PARTICIPATION",

# SET UP YOUR TEAM
# "SET UP YOUR TEAM",
"CONFIGUREZ VOTRE ÉQUIPE",

# Associated text for setting up a team
# "If you are interested in setting up a team of your own, you can get started here.",
"Si vous souhaitez configurer votre propre équipe, vous pouvez commencer ici.",

# START A TEAM button
# "START A TEAM",
"CRÉER UNE ÉQUIPE",

# CHANGE YOUR TEAM INFO button
# "CHANGE YOUR TEAM INFO",
"MODIFIER VOTRE ÉQUIPE",

# Lost team password? link
# "Lost team password?",
"Mot de passe d'équipe perdu?",

# Heading 1
# "MONITORING STATS UPDATES AUTOMATICALLY: AVAILABLE DOWNLOADS AND RULES OF USE",
"SURVEILLANCE AUTOMATIQUE DES STATISTIQUES : TÉLÉCHARGEMENTS ET RÈGLES D'USAGE",

# Text block
# "The donor and team stats are updated every hour, although this can be delayed if there were a lot of work units to come back during that hour. We have been turning off web access to the stats database during stats updates (usually on the hour).
# Please do not use scripts to access the donor or team pages, but use the full donor list (flat files) instead. IP addresses which do not abide by our robots.txt rules will be banned."
"Les statisitques des donateurs et de des équipes sont mises à jour toutes les heures, bien qu'un délai soit possible si un grand nombre d'unités de travail doit être retourné durant cette heure. Nous suspendons l'accès à la base de données des statistiques durant la mise à jour (habituallement dans l'heure).
Merci de ne pas utiliser des scripts pour consulter les pages des donateurs et/ou des équipes : veuillez utiliser la liste complète des donateurs. Les adresses IP qui ne ne respectent pas nos règles seront bannies."
]
5 changes: 1 addition & 4 deletions Localization/it-IT/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

5 changes: 1 addition & 4 deletions Localization/ja-JP/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

5 changes: 1 addition & 4 deletions Localization/ko-KR/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

1 change: 1 addition & 0 deletions Localization/ko-KR/home.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
url: "https://foldingathome.org/"
title: "Folding@home"
language: "ko-KR"
text: [
# I AM One IN A MILLION bold text
Expand Down
5 changes: 1 addition & 4 deletions Localization/nl-NL/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

5 changes: 1 addition & 4 deletions Localization/pt-PT/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

5 changes: 1 addition & 4 deletions Localization/ru-RU/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

5 changes: 1 addition & 4 deletions Localization/sk-SK/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

5 changes: 1 addition & 4 deletions Localization/sv-SE/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

5 changes: 1 addition & 4 deletions Localization/zh-CN/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

58 changes: 58 additions & 0 deletions validate_yaml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env python3

import fnmatch
import yaml
import traceback
import os


def find(pattern, path):
result = []
for root, dirs, files in os.walk(path):
for name in files:
if fnmatch.fnmatch(name, pattern):
result.append(os.path.join(root, name))
return result


# eg: Localization/en-US/statistics.yaml
def path_to_language(file):
(head, tail) = os.path.split(file)
(head, tail) = os.path.split(head)
return tail


def filename_is(path, filename):
(head, tail) = os.path.split(path)
return tail == filename


def ensure_schema(translation, path):
keys = ["url", "language", "text", "title"]

for key in keys:
if key not in translation:
raise Exception("Missing '%s' key in %s" % (key, path))


def ensure_language(translation, path):
expected_language = path_to_language(path)
if translation["language"] != expected_language:
raise Exception(
"%s was expected to be in language %s, but instead was %s" %
(path, expected_language, translation["language"]))


exit_code = 0
for path in find("*.yaml", "Localization"):
with open(path) as f:
print("Validating", path)
try:
translation = yaml.safe_load(f)
ensure_schema(translation, path)
ensure_language(translation, path)
except Exception as e:
exit_code = 1
traceback.print_exc()

exit(exit_code)

0 comments on commit 0a4f5d0

Please sign in to comment.