<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Hi Axel,<br></div><div><br></div><div>Please make sure you are using client version 3.4.1 as there is a bug fix specific to mapping rules.</div><div><br></div><div>The pattern is to match one or more source documents. For a matched source document, its translation file location will be determined or defined using the rule.</div><div><br></div><div>If your file structure is like following (where {projectRoot} is the root of your project and where zanata.xml lives):</div><div>{projectRoot}/templates/messages/kdeedu/kalzium.pot</div><div>{projectRoot}/templates/messages/kdeedu/artikulate.pot</div><div>{projectRoot}/eo/messages/kdeedu/kalzium.po</div><div>{projectRoot}/eo/messages/kdeedu/artikulate.po</div><div><br></div><div>You can use below configuration:</div><div><src-dir>templates</src-dir></div><div><trans-dir>.</trans-dir></div><div><rules></div><div>    <rule pattern="**/*.pot">{locale}/{path}/{filename}.po</rule></div><div></rules></div><div><br></div><div>I will explain the details here. Once you define your <src-dir> as template, file "templates/messages/kdeedu/kalzium.pot" will be mapped to a relative path file name which is "messages/kdeedu/kalzium.pot". It then will be partitioned into several tokens to form the variables. "messages/kdeedu/" become the {path}. "kalzium" become the {filename}. Given our <trans-dir> is defined as "." which means the same directory as zanata.xml or {projectRoot}. And rule is defined as {locale}/{path}/{filename}.po, for locale "eo", translation file will be written to or read from "{projectRoot}/eo/messages/kdeedu/kalzium.po". You can also replace {locale} with {locale_with_underscore} if you want all your locales to use underscore instead of hyphen. e.g. de-DE will become de_DE. </div><div><br></div><div>I hope this will make more sense. If you need further assistance please let us know.</div><div><br></div><div>Regards,</div><div><span name="x"></span>Patrick Huang<br>Senior Software Engineer<br>Engineering - Internationalisation<br>Red Hat<span name="x"></span><br></div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Axel Rousseau" <axel.rousseau@esperanto-france.org><br><b>To: </b>"zanata-users" <zanata-users@redhat.com><br><b>Sent: </b>Thursday, March 5, 2015 8:30:44 PM<br><b>Subject: </b>[zanata-users] How to configure the "rules" section of the        zanata.xml<br><div><br></div><div dir="ltr"><div style="font-size:12.8000001907349px">Hi !</div><div style="font-size:12.8000001907349px">My name is Axel Rousseau, i'm member of the esperanto team to translate KDE.</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">I need some help to configure my zanata.xml to find my .po files</div><div style="font-size:12.8000001907349px">I've a lot of files to translate and the name of the file is : my_path/my_file.po</div><div style="font-size:12.8000001907349px">(and not my_path/my_file/locale.po)</div><div style="font-size:12.8000001907349px">i don't understand how to configure the rules tag in the zanata.xml file</div><div style="font-size:12.8000001907349px">I read the documentation here : <a href="http://zanata.org/help/cli/cli-configuration/" target="_blank">http://zanata.org/help/cli/cli-configuration/</a></div><div style="font-size:12.8000001907349px">and i don't understand the example : </div><div style="font-size:12.8000001907349px"><rules>   </div><div style="font-size:12.8000001907349px">  <rule pattern="**/pot/*.pot">{locale}/{path}/{filename}.po</rule>   </div><div style="font-size:12.8000001907349px">  <rule pattern="**/po/*.pot">{path}/{locale_with_underscore}.po</rule> </div><div style="font-size:12.8000001907349px"></rules></div><div style="font-size:12.8000001907349px">what's mean the pattern ?</div><div style="font-size:12.8000001907349px">why are they 2 lines ? (**/pot/*.pot and **/po/*.pot) ?</div><div style="font-size:12.8000001907349px">I success to upload (push) with the zanata-cli the source files (the .pot files), but i didn't succes to push the translation files (the .po)</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">here are my zanata.xml file :</div><div style="font-size:12.8000001907349px"><?xml version="1.0" encoding="UTF-8" standalone="yes"?></div><div style="font-size:12.8000001907349px"><config xmlns="<a href="http://zanata.org/namespace/config/" target="_blank">http://zanata.org/namespace/config/</a>"></div><div style="font-size:12.8000001907349px">  <url><a href="https://translate.zanata.org/zanata/" target="_blank">https://translate.zanata.org/zanata/</a></url></div><div style="font-size:12.8000001907349px">  <project>kde-eo</project></div><div style="font-size:12.8000001907349px">  <project-version>kdeedu</project-version></div><div style="font-size:12.8000001907349px">  <project-type>gettext</project-type></div><div style="font-size:12.8000001907349px">  <src-dir>templates/messages/kdeedu</src-dir></div><div style="font-size:12.8000001907349px">  <trans-dir>eo/messages/kdeedu</trans-dir></div><div style="font-size:12.8000001907349px">  <locales></div><div style="font-size:12.8000001907349px">    <locale>eo</locale></div><div style="font-size:12.8000001907349px">  </locales></div><div style="font-size:12.8000001907349px">  <rules></div><div style="font-size:12.8000001907349px">    ??? what should i write here ???</div><div style="font-size:12.8000001907349px">  </rules></div><div style="font-size:12.8000001907349px"></config></div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">and my files are like :</div><div style="font-size:12.8000001907349px">eo/messages/kdeedu/kalzium.po</div><div style="font-size:12.8000001907349px">eo/messages/kdeedu/artikulate.po</div><div style="font-size:12.8000001907349px">...</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">I would like to test with only one folder of the KDE files at first...</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">Thank you for your help,</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">Axel Rousseau</div></div>
<br>_______________________________________________<br>zanata-users mailing list<br>zanata-users@redhat.com<br>https://www.redhat.com/mailman/listinfo/zanata-users</blockquote><div><br></div></div></body></html>