Discussion:
[cc-devel] Converting CC translation strings from Transifex to PHP-usable format
Tarmo Toikkanen
2014-03-17 07:56:38 UTC
Permalink
Hi developers!

Is someone aware of a nice library or script that can convert CC translation strings from Transifex to a format usable in PHP?s i18n framework? Specifically the placeholders are marked differently in the Transifex strings and in PHP, so they need to be rewritten. Is there a tool to do this already?

--
Tarmo Toikkanen
tarmo at iki.fi
http://tarmo.fi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ibiblio.org/pipermail/cc-devel/attachments/20140317/18195bfa/attachment.html
Maarten Zeinstra
2014-03-17 09:56:31 UTC
Permalink
Hi Tarmo,

Could you elaborate? I can easily download the strings in one language
useable using the PHP gettext functionality.

If you are looking to replace the paramaters that CC build in
like: %(lookup_uri)s you would have to build something yourrself because
that is part of the python framework that is used. It would be relatively
simple to create a script that goes through every line in the .po file and
replaces %(..)s with something in an array.

I don't seem to be able to find where they replace these in the python
files on github though.

Best,

Maarten
Post by Tarmo Toikkanen
Hi developers!
Is someone aware of a nice library or script that can convert CC
translation strings from Transifex to a format usable in PHP's i18n
framework? Specifically the placeholders are marked differently in the
Transifex strings and in PHP, so they need to be rewritten. Is there a tool
to do this already?
--
Tarmo Toikkanen
tarmo at iki.fi
http://tarmo.fi
_______________________________________________
cc-devel mailing list
cc-devel at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/cc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ibiblio.org/pipermail/cc-devel/attachments/20140317/098a64b7/attachment.html
Tarmo Toikkanen
2014-03-17 17:12:55 UTC
Permalink
Yep, basically I?m looking for a function that someone?s already made to convert python placeholders to PHP placeholders. Coding it by hand seems silly if it?s already been made. And I do know that the Python placeholders may have various syntaxes, so using a properly coded piece of code seems better than coding my own solution example by example. But if no-one?s ever needed this before (which I find a bit unlikely), I guess I need to do it...

--
Tarmo Toikkanen
tarmo at iki.fi
http://tarmo.fi
Post by Maarten Zeinstra
Hi Tarmo,
Could you elaborate? I can easily download the strings in one language useable using the PHP gettext functionality.
If you are looking to replace the paramaters that CC build in like: %(lookup_uri)s you would have to build something yourrself because that is part of the python framework that is used. It would be relatively simple to create a script that goes through every line in the .po file and replaces %(..)s with something in an array.
I don't seem to be able to find where they replace these in the python files on github though.
Best,
Maarten
Post by Tarmo Toikkanen
Hi developers!
Is someone aware of a nice library or script that can convert CC translation strings from Transifex to a format usable in PHP?s i18n framework? Specifically the placeholders are marked differently in the Transifex strings and in PHP, so they need to be rewritten. Is there a tool to do this already?
--
Tarmo Toikkanen
tarmo at iki.fi (mailto:tarmo at iki.fi)
http://tarmo.fi
_______________________________________________
cc-devel mailing list
cc-devel at lists.ibiblio.org (mailto:cc-devel at lists.ibiblio.org)
http://lists.ibiblio.org/mailman/listinfo/cc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ibiblio.org/pipermail/cc-devel/attachments/20140317/a115fa3c/attachment.html
Maarten Zeinstra
2014-03-18 07:46:23 UTC
Permalink
Hi Tarmo,

Well this mailinglist is 1. not very active and 2. more specialised in the
infrastructure of creative commons tech. This seems more like a general
programming question. You might want to have a look at:
https://stackoverflow.com/questions/8920139/improved-sprintf-for-php

Cheers,

Maarten
Yep, basically I'm looking for a function that someone's already made to
convert python placeholders to PHP placeholders. Coding it by hand seems
silly if it's already been made. And I do know that the Python placeholders
may have various syntaxes, so using a properly coded piece of code seems
better than coding my own solution example by example. But if no-one's ever
needed this before (which I find a bit unlikely), I guess I need to do it...
--
Tarmo Toikkanen
tarmo at iki.fi
http://tarmo.fi
Hi Tarmo,
Could you elaborate? I can easily download the strings in one language
useable using the PHP gettext functionality.
If you are looking to replace the paramaters that CC build in
like: %(lookup_uri)s you would have to build something yourrself because
that is part of the python framework that is used. It would be relatively
simple to create a script that goes through every line in the .po file and
replaces %(..)s with something in an array.
I don't seem to be able to find where they replace these in the python
files on github though.
Best,
Maarten
Hi developers!
Is someone aware of a nice library or script that can convert CC
translation strings from Transifex to a format usable in PHP's i18n
framework? Specifically the placeholders are marked differently in the
Transifex strings and in PHP, so they need to be rewritten. Is there a tool
to do this already?
--
Tarmo Toikkanen
tarmo at iki.fi
http://tarmo.fi
_______________________________________________
cc-devel mailing list
cc-devel at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/cc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ibiblio.org/pipermail/cc-devel/attachments/20140318/9a3afd77/attachment.html
Loading...