Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Definition of source-language #78

Closed
leokolln opened this issue Nov 8, 2012 · 3 comments
Closed

Definition of source-language #78

leokolln opened this issue Nov 8, 2012 · 3 comments

Comments

@leokolln
Copy link

leokolln commented Nov 8, 2012

On the generated xliff file of an extract, the source-language is always source-language="en".

I'm developing my app in pt_BR (so it should be the source-language, right?), my config.yml:

framework:
    default_locale: pt_BR
    translator: { fallback: pt_BR }

So, if i extract using:

php app/console translation:extract pt_BR
php app/console translation:extract fr
php app/console translation:extract en

I get respectively (example):

<file date="2012-11-08T15:11:54Z" source-language="en" target-language="pt_BR" datatype="plaintext" original="not.available">

<file date="2012-11-08T15:26:38Z" source-language="en" target-language="fr" datatype="plaintext" original="not.available">

<file date="2012-11-08T15:26:43Z" source-language="en" target-language="en" datatype="plaintext" original="not.available">

So, 2 points:

  • There should be a way to define source-language`.
  • If the extracted language is equal to the defined source-language, there should be an target-language (as in the en example)?

I believe that there should be a new configuration parameter, as nor default_locale or fallback have the meaning for a "Strings are in X locale".
As each bundle can be written in different "source-languages" maybe the option should be defined when the extraction happens?

@tobias-nawa
Copy link

This is still a problem for me. I'm writing my strings in german an the source-language in the xliff files is always "en". And that's a problem for my translation tool Matecat.

@ingedgarmorales
Copy link

Hi There,

You only need to add the parameter 'source_language' in your config.yml

jms_translation:
    source_language: "%locale%"
    configs:
        app:
            dirs: [%kernel.root_dir%, %kernel.root_dir%/../src]
            output_dir: %kernel.root_dir%/Resources/translations
            ignored_domains: [routes]
            excluded_names: ["*TestCase.php", "*Test.php", "*.php"]
            excluded_dirs: [cache, data, logs]

For example:

jms_translation:
    source_language: "es_ES"

output:

<file date="2016-06-11T06:53:19Z" source-language="es_ES" target-language="it_IT" datatype="plaintext" original="not.available">

and

jms_translation:
    source_language: "de_DE"

output:

<file date="2016-06-11T06:53:19Z" source-language="de_DE" target-language="it_IT" datatype="plaintext" original="not.available">

@Nyholm
Copy link
Collaborator

Nyholm commented Aug 4, 2016

Thank you @ingedgarmorales

@Nyholm Nyholm closed this as completed Aug 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants