Re: [patch] DRAFT websites-replace-transifex-client-in-favor-of-zanata.patc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 19, 2015 at 9:25 PM, Kévin Raymond
<shaiton@xxxxxxxxxxxxxxxxx> wrote:
> Hi there, I have nothing set up top properly send patch through email,
> but this is just a first draft in order to get review.
>
> As we are moving translations to zanata, websites have to pull
> translations from there.
> This patch:
> - suppose transifex translation is frozen. Not pulling from there
> anymore, we can drop the transifex-client support
> - installs zanata-python-client
> - don't set up correct API KEY. I don't know how to define this
> (replacing (fedoraDummyTransifexPassword)
> - sync translations on the previous directory (oh, we might remove the
> previous archive. Is there a way with puppet to remove a directory at
> first setup ?)
>
> -we need to check it, and edit our Makefiles accordingly (on the
> websites repository)
>
> It would be nice to use zanata ASAP.
> Please, give me your thoughts. Even If I have to split the patch (to
> remove transifex..)
> Also, I have no idea about freeze time.
>
> Cheers,
>

Ok, I made the change on the websites repo (alpha branch)
This is a freeze request in order to apply this 2 patches, and fix
what needs to be
(at least API KEY on the zanata template file and removing the po_dir
in the builder)

This patches are applied under my repository at shaiton@lockbox01 in any case..
Not sure how to handle syncTranslation on the stg builder... But we
locked translations under master, we might then just drop transifex
support.
I will be available tomorrow afternoon to ping you about this..



-- 
Kévin Raymond
(shaiton)
GPG-Key: A5BCB3A2
From d1dfeae91c7d48f91f222a350a82710adc287184 Mon Sep 17 00:00:00 2001
From: Kevin Raymond <shaiton@xxxxxxxxxxxxxxxxx>
Date: Tue, 24 Feb 2015 19:14:47 +0000
Subject: [PATCH 2/2] fedora-web: syncTranslations: uses zanata

---
 modules/fedora-web/files/syncTranslations.sh |   39 ++++++++++++-------------
 1 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/modules/fedora-web/files/syncTranslations.sh b/modules/fedora-web/files/syncTranslations.sh
index 7644b41..6f4d9a5 100644
--- a/modules/fedora-web/files/syncTranslations.sh
+++ b/modules/fedora-web/files/syncTranslations.sh
@@ -1,29 +1,28 @@
 #!/bin/bash
-# this script pull all translations from the transifex Websites project.
+# this script pull all translations from the zanata Websites project.
 # It pulls every resources.
 
 PO_DIR=/var/tmp/po_dir
+SITES="boot.fedoraproject.org \
+       fedoracommunity.org \
+       fedorahosted.org \
+       fedoraproject.org \
+       getfedora.org \
+       spins.fedoraproject.org \
+       start.fedoraproject.org"
 
-# hack for tx-client, since it currently only is able to find
-# config file in ~/.transifexrc and apache's $HOME isn't a good location
-export HOME=/var/lib/transifex-client
+# hack for zanata-client, since it currently only is able to find
+# config file in ~/.config/zanata.ini and apache's $HOME isn't a good location
+export HOME=/var/lib/zanata
 
-init()
-{
-  # init
-  [ -d .tx ] || mkdir .tx
-  echo "[main]" > .tx/config
-  echo "host = https://www.transifex.com"; >> .tx/config
-
-  # configure
-  tx set --auto-remote https://fedora.transifex.com/projects/p/fedora-web/
-  # You should edit .tx/config file to comment some resources (like talk)
-}
-
-cd $HOME
-[ -f .tx/config ] || init
 [ -d $PO_DIR ] || mkdir $PO_DIR
 
-tx -q pull -a --minimum-perc 10 1> /dev/null
+for site in $SITES
+do
+  [ -d $PO_DIR/$site ] || mkdir -p $PO_DIR/$site
+  cp $HOME/sample.xml $PO_DIR/$site/zanata.xml
+  sed -i "s/@VERSION@/$site/" $PO_DIR/$site/zanata.xml
+  cd $PO_DIR/$site
+  zanata pull
+done
 
-rsync -az translations/* $PO_DIR
-- 
1.7.2.1

From 4fecfc60707463d50aaf950345e366439e4e6d39 Mon Sep 17 00:00:00 2001
From: Kevin Raymond <shaiton@xxxxxxxxxxxxxxxxx>
Date: Thu, 19 Feb 2015 20:12:00 +0000
Subject: [PATCH 1/2] websites: replace transifex-client in favor of zanata-python-client.

We are moving from transifex.net to fedora.zanata.org.
Makes websites builder pulling from the new server.
---
 modules/fedora-web/manifests/init.pp               |    2 +-
 modules/transifex/README                           |    1 -
 modules/transifex/manifests/init.pp                |   22 ----
 modules/transifex/templates/client/transifexrc.erb |   11 --
 modules/zanata/README                              |    1 +
 modules/zanata/manifests/init.pp                   |   29 ++++++
 modules/zanata/templates/client/sample.xml         |  106 ++++++++++++++++++++
 modules/zanata/templates/client/zanata.erb         |    4 +
 8 files changed, 141 insertions(+), 35 deletions(-)
 delete mode 100644 modules/transifex/README
 delete mode 100644 modules/transifex/manifests/init.pp
 delete mode 100644 modules/transifex/templates/client/transifexrc.erb
 create mode 100644 modules/zanata/README
 create mode 100644 modules/zanata/manifests/init.pp
 create mode 100644 modules/zanata/templates/client/sample.xml
 create mode 100644 modules/zanata/templates/client/zanata.erb

diff --git a/modules/fedora-web/manifests/init.pp b/modules/fedora-web/manifests/init.pp
index 928d09a..4c39d43 100644
--- a/modules/fedora-web/manifests/init.pp
+++ b/modules/fedora-web/manifests/init.pp
@@ -2,7 +2,7 @@ class fedora-web::build {
     include git::package
     include rsync::server
     include scripts::lock-wrapper
-    include transifex::client
+    include zanata::client
 
     package { [
         "python-setuptools",
diff --git a/modules/transifex/README b/modules/transifex/README
deleted file mode 100644
index 24b6f62..0000000
--- a/modules/transifex/README
+++ /dev/null
@@ -1 +0,0 @@
-Transifex Module
diff --git a/modules/transifex/manifests/init.pp b/modules/transifex/manifests/init.pp
deleted file mode 100644
index 3d645cb..0000000
--- a/modules/transifex/manifests/init.pp
+++ /dev/null
@@ -1,22 +0,0 @@
-class transifex::client {
-
-    package { "transifex-client":
-        ensure => installed,
-    }
-
-    file { "/var/lib/transifex-client":
-        owner   => "apache",
-        group   => "transifex",
-        mode    => 0550,
-        ensure  => directory,
-    }
-
-    # needed to pull po files in tx
-    file { "/var/lib/transifex-client/.transifexrc":
-        owner   => "apache",
-        group   => "apache",
-        mode    => 0600,
-        content => template("transifex/client/transifexrc.erb"),
-    }
-
-}
diff --git a/modules/transifex/templates/client/transifexrc.erb b/modules/transifex/templates/client/transifexrc.erb
deleted file mode 100644
index ed9122f..0000000
--- a/modules/transifex/templates/client/transifexrc.erb
+++ /dev/null
@@ -1,11 +0,0 @@
-[https://www.transifex.com]
-username = fedoradummy
-token =
-password = <%= fedoraDummyTransifexPassword %>
-hostname = https://www.transifex.com
-
-[https://fedora.transifex.com]
-username = fedoradummy
-token =
-password = <%= fedoraDummyTransifexPassword %>
-hostname = https://fedora.transifex.com
diff --git a/modules/zanata/README b/modules/zanata/README
new file mode 100644
index 0000000..31514af
--- /dev/null
+++ b/modules/zanata/README
@@ -0,0 +1 @@
+Zanata Module
diff --git a/modules/zanata/manifests/init.pp b/modules/zanata/manifests/init.pp
new file mode 100644
index 0000000..a40b195
--- /dev/null
+++ b/modules/zanata/manifests/init.pp
@@ -0,0 +1,29 @@
+class zanata::client {
+
+    package { "zanata-python-client":
+        ensure => installed,
+    }
+
+    file { "/var/lib/zanata/.config":
+        owner   => "apache",
+        group   => "zanata",
+        mode    => 0550,
+        ensure  => directory,
+    }
+
+    # needed to pull po files in zanata
+    file { "/var/lib/zanata/.config/zanata.ini":
+        owner   => "apache",
+        group   => "apache",
+        mode    => 0600,
+        content => template("zanata/client/zanata.erb"),
+    }
+
+    # provide a default config file
+    file { "/var/lib/zanata/sample.xml":
+        owner   => "apache",
+        group   => "apache",
+        mode    => 0600,
+        content => template("zanata/client/sample.xml"),
+    }
+}
diff --git a/modules/zanata/templates/client/sample.xml b/modules/zanata/templates/client/sample.xml
new file mode 100644
index 0000000..feb6b9d
--- /dev/null
+++ b/modules/zanata/templates/client/sample.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<config xmlns="http://zanata.org/namespace/config/";>
+  <url>https://fedora.zanata.org/</url>
+  <project>fedora-web</project>
+  <project-version>@VERSION@</project-version>
+  <project-type>gettext</project-type>
+
+  <locales>
+    <locale>sq</locale>
+    <locale>ar</locale>
+    <locale>as</locale>
+    <locale>ast</locale>
+    <locale>bal</locale>
+    <locale>eu</locale>
+    <locale>bn</locale>
+    <locale map-from='bn_IN'>bn-IN</locale>
+    <locale>brx</locale>
+    <locale>bs</locale>
+    <locale>br</locale>
+    <locale>bg</locale>
+    <locale>ca</locale>
+    <locale map-from='zh_CN'>zh-CN</locale>
+    <locale>zh-HK</locale>
+    <locale map-from='zh_TW'>zh-TW</locale>
+    <locale>kw</locale>
+    <locale>kw-GB</locale>
+    <locale>cs</locale>
+    <locale>da</locale>
+    <locale>nl</locale>
+    <locale map-from='en_GB'>en-GB</locale>
+    <locale>eo</locale>
+    <locale>et</locale>
+    <locale>fi</locale>
+    <locale>fr</locale>
+    <locale>gl</locale>
+    <locale>ka</locale>
+    <locale>de</locale>
+    <locale>el</locale>
+    <locale>gu</locale>
+    <locale>he</locale>
+    <locale>hi</locale>
+    <locale>hu</locale>
+    <locale>is</locale>
+    <locale>id</locale>
+    <locale>ia</locale>
+    <locale>it</locale>
+    <locale>ja</locale>
+    <locale>kn</locale>
+    <locale>kk</locale>
+    <locale>km</locale>
+    <locale>ky</locale>
+    <locale>ko</locale>
+    <locale>lt</locale>
+    <locale>nds</locale>
+    <locale>mk</locale>
+    <locale>mai</locale>
+    <locale>ms</locale>
+    <locale>ml</locale>
+    <locale>mr</locale>
+    <locale>mn</locale>
+    <locale>ne</locale>
+    <locale>nb</locale>
+    <locale>nn</locale>
+    <locale>or</locale>
+    <locale>pa</locale>
+    <locale>fa</locale>
+    <locale>pl</locale>
+    <locale>pt</locale>
+    <locale map-from='pt_BR'>pt-BR</locale>
+    <locale>ro</locale>
+    <locale>ru</locale>
+    <locale>sr</locale>
+    <locale>sr@latin</locale>
+    <locale>si</locale>
+    <locale>sk</locale>
+    <locale>sl</locale>
+    <locale>es</locale>
+    <locale>sv</locale>
+    <locale>tg</locale>
+    <locale>ta</locale>
+    <locale>te</locale>
+    <locale>bo</locale>
+    <locale>tr</locale>
+    <locale>uk</locale>
+    <locale>ur</locale>
+    <locale>wba</locale>
+    <locale>cy</locale>
+    <locale>lv</locale>
+    <locale>kw@uccor</locale>
+    <locale>kw@kkcor</locale>
+    <locale>af</locale>
+    <locale>am</locale>
+    <locale>be</locale>
+    <locale>hr</locale>
+    <locale map-from='de_CH'>de-CH</locale>
+    <locale>th</locale>
+    <locale>vi</locale>
+    <locale>zu</locale>
+    <locale>ilo</locale>
+    <locale>nso</locale>
+    <locale>tw</locale>
+    <locale>yo</locale>
+    <locale>anp</locale>
+  </locales>
+
+</config>
diff --git a/modules/zanata/templates/client/zanata.erb b/modules/zanata/templates/client/zanata.erb
new file mode 100644
index 0000000..1e37569
--- /dev/null
+++ b/modules/zanata/templates/client/zanata.erb
@@ -0,0 +1,4 @@
+[servers]
+fedora_zanata_org.url=https://fedora.zanata.org/
+fedora_zanata_org.username=fedoradummy
+fedora_zanata_org.key=<%= fedoraDummyTransifexPassword %>
-- 
1.7.2.1

_______________________________________________
infrastructure mailing list
infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/infrastructure

[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux