How to configure the new GitHub Integration correctly?

Hello guys,

I’m trying to configure the new GitHub integration, but I did not succeed.

I followed all these steps in the documentation.

Here is my YAML config:

filters:
  - filter_type: dir
    file_format: KEYVALUEJSON
    source_file_extension: json
    source_language: en
    source_file_dir: locales/en/translation.json
    translation_files_expression: locales/<lang>/translation.json

My folder structure:

GitHub Repo/locales/en/translation.json
GitHub Repo/locales/fr/translation.json
GitHub Repo/locales/es/translation.json
GitHub Repo/locales/pt-BR/translation.json
GitHub Repo/locales/vi/translation.json

My translation file:

{
	"key": {
		"key2": "value"
	},
	"key": {
		"key2": "value"
	},
}

After making all the settings, nothing happens.

What have I done wrong, can anyone help me?

Hello @Demartini ,

It seems like you want to sync just a single source file and its translations. So you should go with the “file” filter type. This is the YAML configuration to achieve this:

filters:
  - filter_type: file
    source_file: locales/en/translation.json
    file_format: KEYVALUEJSON
    source_language: en
    translation_files_expression: locales/<lang>/
1 Like

Hi @rigas,

Thank you very much for the answer, it was just what I needed. :smiley:

Worked perfectly.

Big hug.

2 Likes

@rigas @Demartini
I have the same problem. I am struggle with the YAML configuration all day today and can make it work. Like Demartini above, i follow all the instructions in GitHub and in transifex but i can’t config properly the YAML file for the sync to work.

I am the creator of the Bello skin for Kodi (an Open Source Home Theater Software) and i am maintaining my code on GitHub, using Transifex for translations.

My translations files are with extension .po and directory structure like this one here and this is the YAML file that i am using:

 filters:
   - filter_type: file
     source_file: language/resource.language.en_gb/strings.po
     file_format: PO
     source_language: en
     translation_files_expression: 'language/<lang>/'

I want my 100% translated files to sync with my github in the same directory structure and naming.

Anyone can help in what am i doing wrong?

Thanks
Nessus



EDITED: Whatever i do i get this in the GitHub Syncing Status window…

also tried this YAML configuration file…

 filters:
   - filter_type: file
     source_file: language/resource.language.en_gb/strings.po
     file_format: PO
     source_language: en
     translation_files_expression: language/resource.language.<lang>/strings.po
 settings:
     language_mapping:
         en: resource.language.en_GB
         ru: resource.language.ru_RU
         el: resource.language.el_GR

Still nothing!!!.

1 Like

Hi @Nessus85100!

Can you try again with the following configuration YAML?

 filters:
   - filter_type: file
     source_file: language/resource.language.en_gb/strings.po
     file_format: PO
     source_language: en
     translation_files_expression: 'language/resource.language.<lang>/' 

The </lang> placeholder would match the whole resource.language.en_au in your case. This match will be used as the language code when uploading translations to Transifex. Of course, this string is not a valid language code, you only want to use the en_au part to be used as your language code. Give it a try!

Hey @rigas
Thanks for the answer.

I’ve try all these with no luck. Also i tried this with or without the strings.po in translation_files_expression…

filters:
   - filter_type: file
     source_file: language/resource.language.en_gb/strings.po
     file_format: PO
     source_language: en
     translation_files_expression: 'language/resource.language.<lang>/strings.po'
settings:
    language_mapping:
        en: resource.language.en_GB
        ru: resource.language.ru_RU
        el: resource.language.el_GR
        au: resource.language.au_AU

Nothing works. Still getting the same errors in GitHub Syncing Status dialog.
I have no idea why and cant think anything else.

Hi @Nessus85100. I think that the mapping is reverse (and also shouldn’t include the resource.language part.

Can you please try with the following too?

filters:
  - filter_type: file
    source_file: language/resource.language.en_gb/strings.po
    file_format: PO
    source_language: en
    translation_files_expression: 'language/resource.language.<lang>/strings.po'
settings:
  language_mapping:
    el_gr: el_GR
    en_au: en_AU
    en_gb: en_GB
    en_nz: en_NZ
    en_us: en_US
1 Like

Thanks for the response @dimitrios

Also this it’s not working. Still getting the same result in GitHub Syncing Status dialog…

I see. Ok, I’ll try to replicate your setup and get back to you as soon as possible @Nessus85100.

Thanks a lot @dimitrios … (Δημητρη, Θωμας απο Ελλαδα!), i really appreciated.

Also forgot to mention that i remove all links, authentications and connections in Transifex & Github and add them again. No luck again. Same result.

@Nessus85100 (Θωμά!) can you please tell us the languages that you have set up on your Transifex project? Both source and target languages.

@dimitrios here they are…

Update: This is the project I want to integration, I don’t know what type of filter_type should I use, and I want to translate the project to Chinese(Simplified).


I’m a newbie of Git and GitHub, I don’t know how to configure a YAML file. Can someone help me?

@Nessus85100 thank you for the screenshot. There seems to be a bug with language_mapping. We are currently investigating and will start working on a fix soon. I’ll let you know as soon as it is released.

Thank you for your patience.

@Nessus85100 can you please try again with the last configuration I had posted?
We’ve made some changes and now the bug should be fixed.

Thank you for your patience!

filters:
  - filter_type: file
    source_file: language/resource.language.en_gb/strings.po
    file_format: PO
    source_language: en
    translation_files_expression: 'language/resource.language.<lang>/strings.po'
settings:
  language_mapping:
    el_gr: el_GR
    en_au: en_AU
    en_gb: en_GB
    en_nz: en_NZ
    en_us: en_US

This also just was a major PITA for me.

Someone should post examples into the doc, instead of just screenshotting it.

This said it worked, but I have no idea how to access the resources now.

filters:

  • filter_type: dir
    file_format: MD
    source_file_extension: MD
    source_language: en
    source_file_dir: /md-pages
    translation_files_expression: ‘/md-pages/’

This is my current one

filters:

  • filter_type: dir
    file_format: GITHUBMARKDOWN
    source_file_extension: md
    source_file_extension: html
    source_language: en
    source_file_dir: /md-pages/en/
    translation_files_expression: '/md-pages/< lang > ’

(make sure you don’t have the blanks between around the tag “lang”)

nested sub-directories with the main language in the root and sub-languages in some subfolders (as common on websites) not supported

Hello Christoph

Try the following configuration:
filters:

  • filter_type: dir
    file_format: GITHUBMARKDOWN
    source_file_extension: md
    source_language: en
    source_file_dir: md-pages/
    translation_files_expression: ‘md-pages//’

Please let me know if this helps