Merge branch 'zanata-integration' into 'develop'

Zanata integration (https://trad.framasoft.org)

See merge request framasoft/framadate!227
This commit is contained in:
Thomas Citharel 2018-02-26 17:29:00 +01:00
commit c5b50050c9
8 changed files with 63 additions and 18 deletions

1
.gitignore vendored
View File

@ -10,6 +10,7 @@ vendor
cache/
tpl_c/
.php_cs.cache
.zanata-cache/
# Temp files
*~

7
.po2json.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
for i in po/*.po
do
j=$(echo $i | cut -d '.' -f 1 | cut -d '/' -f 2)
po2json -i $i -t locale/en.json --progress none | ./.renest_json.pl > po/$j.json
mv po/$j.json locale/$j.json
done

26
.renest_json.pl Executable file
View File

@ -0,0 +1,26 @@
#!/usr/bin/perl
use strict;
use warnings;
use JSON;
#use Hash::Merge::Simple qw(merge);
my $json = JSON->new->utf8->space_before(0)->space_after(1)->indent(4)->canonical(1);
my $new_json = {};
my $old_json = '';
while (defined(my $line = <STDIN>)) {
$old_json .= $line;
}
$old_json = decode_json($old_json);
for my $key (keys %{$old_json}) {
$key =~ m/^([^.]*)\.(.*)$/;
my $real_key = $1;
my $trad_key = $2;
$new_json->{$real_key}->{$trad_key} = $old_json->{$key} if $old_json->{$key};
}
print $json->encode($new_json);

10
Makefile Normal file
View File

@ -0,0 +1,10 @@
push-locales:
json2po -P -i locale/en.json -t locale/en.json -o po/framadate.pot
zanata-cli -q -B push
pull-locales:
zanata-cli -q -B pull
./.po2json.sh
stats-locales:
zanata-cli -q stats

View File

@ -13,12 +13,12 @@ Si vous souhaitez travailler avec nous, **forkez-nous sur [framagit.org](https:/
Un fichier est dédié à l'installation de framadate : [INSTALL.md](INSTALL.md).
# Comment contribuer
# Comment contribuer avec du code
## De votre côté
1. Créer un compte sur [https://git.framasoft.org](https://git.framasoft.org)
1. Créer un fork du projet principal : [Créer le fork](https://git.framasoft.org/framasoft/framadate/fork/new)
1. Créer un compte sur [https://framagit.org](https://framagit.org)
1. Créer un fork du projet principal : [Créer le fork](https://framagit.org/framasoft/framadate/fork/new)
1. Créer une branche nommée feature/[Description] à partir de la branche **develop**
* Où [Description] est une description en anglais très courte de ce qui va être fait
1. Faire des commits dans votre branche
@ -45,6 +45,11 @@ Un fichier est dédié à l'appréhension du code de framadate : [Document techn
Les traductions se trouvent dans le dossier `locale`. Chaque langue est dans un fichier JSON différent organisé par section.
Ne modifiez pas directement les fichiers !
Si vous avez des modifications à y apporter (voire ajouter une nouvelle traduction), allez sur <https://trad.framasoft.org> (tout y est expliqué sur la page d'accueil).
La page de traduction du projet Framadate est <https://trad.framasoft.org/zanata/iteration/view/framadate/master>.
# Synthèses des librairies utilisées
[Smarty](http://www.smarty.net/),

2
po/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -1,15 +0,0 @@
<?php
include_once __DIR__ . '/app/inc/init.php';
?>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body><pre><?php
$lang = 'fr_FR';
$po = file_get_contents(__DIR__ . '/locale/' . $lang . '/LC_MESSAGES/Studs.po');
$converter = new \o80\convert\Po2JsonConverter();
$json = $converter->convert($po);
print_r($json);
?></pre></body>
</html>

9
zanata.xml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config xmlns="http://zanata.org/namespace/config/">
<url>https://trad.framasoft.org/zanata/</url>
<project>framadate</project>
<project-version>master</project-version>
<project-type>gettext</project-type>
<src-dir>po</src-dir>
<trans-dir>po</trans-dir>
</config>