[lfs-fr] LFS Translation

amj amj at tdct.org
Mer 14 Mai 12:42:47 PDT 2014


Hi
(Sorry if my English isn't very good :/ )

About the po's we have as project to use po4a, it's a po converter
supported by Debian. http://po4a.alioth.debian.org/

LFS: the make script works to produce the po's FR/EN with the sources 
but we didn't have enough created the script to recreate the po with a
new EN version to translate. We also didn't have created the script
witch recreate the French sources with the po and the English version.

BLFS:The "POisation" doesn't work :(  (it's possible that's it's because
it isn't the same coding but normally it must work  )

But this script is already useful becausehe have allowed to find some
tags errors in the French version of lfs.

We probably will (re)code the script in bash. ( because i think that the
makefiles are even more unreadable than the XML :D )

If you search i think you can find the makefiles of some projects that
translate docbook's.

for the ent's files I think that a sed script is more useful.


Le 14/05/14 00:44, Alberto Senna Dias Neto a écrit :
> 2014-05-13 15:03 GMT-03:00 MENGUAL Jean-Philippe <
> jmengual at linuxfromscratch.org>:
>
>>  Hi,
>> It's a thought we have, in particular an idea to use a po system. The
>> thought is in progress.
>>
> Tell us if you want further info.
>> Regards,
>>
>> --
>> Jean-Philippe MENGUAL
>> Président de l'association traduc.org
>> Coordinateur francophone du projet Linux From Scratch
>> Animateur suppléant du groupe de travail Accessibilité de l'April
>> Administrateur d'accelibreinfo
>>
>>
> Thanks for the welcome!
> About this thought on po system. How, exactly, are you doing this? What
> have you done so far?
>
> I have been using Itstool ( http://itstool.org/ ) to generate po files ( po
>> mo > merge mo with original xml generating translated xml), but in the
> process I have some issues.
>
> Some of the issues:
> 1 - itstool expands the .ent files inside all the translated xml files, so
> the translated xml file is not an elegant one;
> 2 - I must to treat any – or — etc, for itstool to work
> properly. I believe the problem is that itstool considers it an entity and
> does not find its definition anywhere, so it crashes. To solve that I have
> to run:
>
>     *************
>
>     #!/bin/bash
>
>     find . -name '*.xml' -exec sed -i 's/\–/\–/g' {} \;
>
>     find . -name '*.xml' -exec sed -i 's/\—/\—/g' {} \;
>
>     find . -name '*.xml' -exec sed -i 's/\©/\©/g' {} \;
>
>     find . -name '*.xml' -exec sed -i 's/\Æ/\Æ/g' {} \;
>
>     find . -name '*.xml' -exec sed -i 's/\é/\é/g' {} \;
>
>     *************
>
> 3 - Itstool does not work well with some entities used on xml files,
> specially the ones like <!ENTITY checkfs            SYSTEM
> "checkfs.script">. For itstool to work properly I had to remove the
> "SYSTEM", translate, and then add it again to automatically generate pdf,
> html, etc.
>
> In this po system that you are working on, have you faced any of those
> issues?
> If so, how are you dealing with that?
>
> I have been trying several other tools, but most of them ends up messing up
> the xml or the po in such a way that it is not worth fixing.
>
> Regards.
>
>

-------------- section suivante --------------
Une pièce jointe HTML a été nettoyée...
URL: <http://lists.linuxfromscratch.org/pipermail/lfs-traducfr/attachments/20140514/80bfc600/attachment.html>
-------------- section suivante --------------
#!/usr/bin/make -f
#
# pour générer les fichiers po à partir d'une traduction en => fr préexistante
#
# les fichiers en anglais doivent se trouver dans en/*/*.xml
# les fichiers traduits en français sont dans fr/*/*.xml
# les fichiers po sont placés dans po/fr/*/*.fr.po
#
# FIXME: les fichiers sont retraduits avec make translate et sont placés dans fr-new/*/*.xml


# dossiers
SOURCE = en/BOOK
CIBLE = lfs
PO = po

# langue
LANGU = fr

XML_CIBLE_FILES = $(wildcard $(CIBLE)/*/*.xml)

PO_FILES = $(patsubst $(CIBLE)/%.xml,$(PO)/$(LANGU)/%.$(LANGU).po, $(XML_CIBLE_FILES))

#NEW_XML_CIBLE_FILES = $(patsubst $(CIBLE)/%,$(CIBLE)-new/%, $(XML_CIBLE_FILES))

NEW_XML_CIBLE_FILES = $(patsubst $(PO)/$(LANGU)/%.$(LANGU).po,$(LANGU)-new/%.xml, $(wildcard $(PO)/$(LANGU)/*/*.$(LANGU).po))

default: $(PO_FILES) 

$(PO)/$(LANGU)/%.$(LANGU).po: $(SOURCE)/%.xml $(CIBLE)/%.xml
	po4a-gettextize -f docbook -m $(SOURCE)/$*.xml -l $(CIBLE)/$*.xml -p $(PO)/$*.$(LANGU).po

translate: $(NEW_XML_CIBLE_FILES)			
	@echo $(PO)/$(LANGU)/*/*.$(LANGU).po			# debug
	@echo $(wildcard $(PO)/$(LANGU)/*/*.$(LANGU).po)	# debug
	@echo $(wildcard po/fr/*/*.fr.po)			# debug
	@echo $(NEW_XML_CIBLE_FILES)				# debug
# pourquoi $(NEW_XML_CIBLE_FILES) est vide ... ?

$(LANGU)-new/%.xml: po/$(LANGU)/%.$(LANGU).po $(SOURCE)/%.xml
	po4a-translate -f docbook -m $(SOURCE)/$*.xml -l $(LANGU)-new/$*.xml -p $(PO)/$(LANG)/$*.$(LANGU).po


More information about the lfs-traducfr mailing list