Weblate: Check for YML support

Created on 6 Mar 2013  路  25Comments  路  Source: WeblateOrg/weblate

Check for YML support, seems to be used by Symfony2.

enhancement translate-toolkit

Most helpful comment

:+1: YAML is also used in every Ruby on Rails app with i18n support.

All 25 comments

Neeeds translate-toolkit support first.

Just for the reference, docs for the format is here:

http://symfony.com/doc/2.0/book/translation.html

:+1: YAML is also used in every Ruby on Rails app with i18n support.

Nested keys are also really interesting, unfortunately yellow has no support to add some contextual information to a translation right?

Hello, any update?

@nijel you've maybe got an update on this? Would be awesome to have the nested yml format as a supported format in weblate, because that would mean we don't have to migrate to xliff and we can keep our IDE support.

No update for this - so far I try to not implement file format support directly in Weblate, but rely on translate-toolkit here.

Also see https://github.com/translate/translate/issues/3248, though it's for Ruby yml, not sure if something generic could be implemented as I didn't look deeper at any of those formats.

PS: This is really becoming crazy, will every framework invent own way of storing translations? Why not just stick with something widely spread already...

Frameworks should just rely on the po, yml or xliff format right? :+1: Don't think the frameworks (should) have their own custom implementation.

Some other info concerning Symfony XLIFF: http://symfony.com/blog/new-in-symfony-2-8-translator-improvements

See https://github.com/nijel/weblate/issues/972 for Xliff 2.0 support...

See https://github.com/nijel/weblate/issues/1040 for more info about the nesting / grouping of translations (if supported by the source format).

Initial support is there, it depends on https://github.com/translate/translate/pull/3500

Awesome @nijel ! 馃憤

I'll test it with Symfony asap. I see you mention "ruby-yaml" quite often, does that dialect has any specific rules? Symfony follows the yaml 1.2 specification, I assume (read: hope) that wil work right? :)

The ruby variant adds top level node with language code, for example:

cs:
    something: N臎co
    other:
         key: Kl铆膷

While others seem to stick with key/value structure:

something: N臎co
other:
     key: Kl铆膷

Anyway this is covered by our docs: https://docs.weblate.org/en/latest/formats.html#yaml-files

I tried to use this by installing the current master branch of Weblate and translate-toolkit. However I can't select Ruby or Yaml format (they are missing in the drop-down list) when adding a new component although the code is present in the source (https://github.com/nijel/weblate/commit/4dbced73cae2aaee194bb7ee1b2b55da0ee0c084) and the corresponding migration for the subproject model (https://github.com/nijel/weblate/commit/d124d1ec12c6223ed22a59e0fa23bde4b688cb71#diff-ba3733a2e2a88ef36b65acf3ecbba45fR22) has been applied. What am I missing?

Maybe you're missing PyYAML being installed? Try importing yaml:

python -c 'import translate.storage.yaml'

That was indeed the cause for the issue, thank you. I'm using a modified version of https://github.com/WeblateOrg/docker which doesn't yet have PyYAML in requirements.txt.

@nijel Hi,
when I try python -c 'import translate.storage.yaml', result is:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named yaml

I try installed PyYaml from source or from pip ......

You need translate toolkit from git or patched with yaml support...

After compile from git .....
WEB: Internal error

ok .. my fault ..
perrmission

and two django version

Was this page helpful?
0 / 5 - 0 ratings