These are chat archives for translate/dev

27th
Sep 2017
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 11:23
@phlax pinggg
good afternoon!
phlax
@phlax
Sep 27 2017 11:54
pong
howsit ?
@jjmcarrascosa ^^
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 12:32
@phlax hi, 1 sec
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 12:41
@phlax , i am creating a project using our new command
phlax
@phlax
Sep 27 2017 12:41
cool!
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 12:41
pootle create_project test2 --source-language en_GB --report-email jjmcar@tmail.com --name test2 --preset-mapping gnu
it creates it ok
but not sure
phlax
@phlax
Sep 27 2017 12:41
great
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 12:41
If this is what I was supposed to get, take a look
image.png
first, the path - but I think this can be fixed easily
what concerns me is the
--preset-mapping gnu
phlax
@phlax
Sep 27 2017 12:42
yep
its not there!
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 12:42
So i was right
phlax
@phlax
Sep 27 2017 12:42
what about ?
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 12:42
Ah
I mean
is that correct
that shows
path mapping preset = CUSTOM
phlax
@phlax
Sep 27 2017 12:43
we should see the path
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 12:43
?
phlax
@phlax
Sep 27 2017 12:43
and no - it should say gnu
and have the mapping like /po/<language_code>.<ext>
listed
my guess...
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 12:44
yes. Well, I can try to force it putting custom and that mapping
phlax
@phlax
Sep 27 2017 12:44
we have set translation_mapping with/out s
do you want to raise a ticket ?
or we could just fix i guess
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 12:45
if we can do something quick... I'm supposed to have it ready for this week
so
explain me again
phlax
@phlax
Sep 27 2017 12:45
i think in command it does...
project.config["pootle_fs.translation_mapping"] = ...
and it should be mappings
or other way round
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 12:46
aaaah
Let me check
project.config["pootle_fs.translation_mapping"] = mapping
phlax
@phlax
Sep 27 2017 12:47
try changing it
and adding another project
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 12:47
on it
phlax
@phlax
Sep 27 2017 12:47
or alternatively
git grep pootle_fs.translation_mapping
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 12:48
fixed
image.png
phlax
@phlax
Sep 27 2017 12:49
this file also needs fixing pootle/apps/pootle_fs/getters.py
if you do the git grep command you can see where one/other is used
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 12:51
I don't have access right now to the server
when I was developing it
but I have changed it in getters.py to
too
another question
{POOTLE_TRANSLATION_DIRECTORY}
Where I am suppose to set this?
is in the settings file?
o django
of
phlax
@phlax
Sep 27 2017 12:55
in the settings file
its good to change it because the default is inside the pootle code directory
translate/pootle#6770
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 12:59
uhmmm
I don't see a directory created
does it create a directory by default?
it should have created something in {POOTLE_TRANSLATION_DIRECTORY} right?
phlax
@phlax
Sep 27 2017 13:01
hmm
well in the old code it did that
but with pootle_fs - no - because the dir may be on a remote fs
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 13:02
but i have localfs does it have anything to do?
Well I'm just wondering where to put the file that users are going to upload.
phlax
@phlax
Sep 27 2017 13:05
create a directory with project code
and put there - according to the path mapping
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 13:05
ah, ok.
I have set the POOTLE_TRANSLATION_DIRECTORY , but it shows it anyway
is that meant to be that way?
Is not replaced?
phlax
@phlax
Sep 27 2017 13:07
in the project form ?
its a placeholder
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 13:07
Yes,
Ah, ok
phlax
@phlax
Sep 27 2017 13:07
so in the db it stores it as {P_T_D}
but it gets subsituted when used
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 13:08
but in the project form it's shown as POOTLE_TRANSLATION_DIRECTORY
phlax
@phlax
Sep 27 2017 13:08
that way you can change it - and dont have to go through each one and update
yep
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 13:08
I was just wondering
that it takes the value and replaces the placeholder
but no, it shows the placeholder, ok
phlax
@phlax
Sep 27 2017 13:08
yep - where its used it it replaces
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 13:08
ok
phlax
@phlax
Sep 27 2017 13:08
where you can edit - it shows the placeholder itself
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 13:08
got it, thank you
so, in gnu-style
I need to put the file
phlax
@phlax
Sep 27 2017 13:11
so gnu style
you need to...
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 13:11
/po/
but the original as a template?
phlax
@phlax
Sep 27 2017 13:11
cd P_T_D
mkdir po
cp my-translation-file.po po/language.po
updated
again
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 13:13
so, if it's from en_GB, for example
the original
to po/en_GB.po
right?
phlax
@phlax
Sep 27 2017 13:14
yep
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 13:17
/pootle/translations/test4/po# ls
en_GB.po
I took it from the tutorial/af/tutorial.po
but I don't see it
is there a way I can check what is my POOTLE TRANSLATION DIRECTORY?
phlax
@phlax
Sep 27 2017 13:19
so next step
pootle fs fetch test4
pootle fs state test4
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 13:20
aah, ok
Untracked files (1)
-------------------
Newly created files in the filesystem

  (/en_GB/test4/en_GB.po)
phlax
@phlax
Sep 27 2017 13:21
so then
pootle fs add test4
pootle fs state test4
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 13:26
well I don't see anything, but probably i need to add a template
right?
and languages?
first?
probably is not en_GB.po but templates.pot ?
phlax
@phlax
Sep 27 2017 13:30
the template needs to be templates.pot - yep
(or template.pot)
checking...
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 13:30
the system says templates.pot
phlax
@phlax
Sep 27 2017 13:31
templates
yep, cool
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 13:32
Uhmm probably I still don't understand well the pipeline
so lets try just with an example templates.pot
I got from the tutorial folder
so I've put it in translations/test4/po/templates.pot
then i do the pootle fs fetch test4 pootle fs state test4
and
```
pootle fs add test4
pootle fs state test4
```
only with that, should I be able to see anything?
Because I don't see anything and the Languages screen says "There are no templates for this project...."
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 13:44
image.png
phlax
@phlax
Sep 27 2017 13:50
fetch and state will just show you what is there
you need to do...
pootle fs add test4
pootle fs sync test4
after fetching
fetch is like git fetch, in that it just brings the upstream data in
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 13:53
Ok , that worked
I can see now the templates.pot
now the next step is creating a language
right?
Can I just copy that template.pot to for exmaple es.po
Will it take it?
Yesssssssssss
Jose J. Martinez
@jjmcarrascosa
Sep 27 2017 13:59
Great, so now what I need to struggle with is with conversions from users files to .po, put it as a template and put it in the folders. And ask for the target language and create instances of the template
Thank you, @phlax ! I will probably disturb you a little bit more tomorrow.
Have a great day
Johannes Marbach
@Johennes
Sep 27 2017 15:30
@unho Thanks for putting so much trust into me. I'll need some more time to add tests for my open PR but I'll try to get to it soonish.