# Github integration with nested files

**URL:** <https://community.transifex.com/t/github-integration-with-nested-files/1986>\
**Category:** Q&A\
**Tags:** integrations, github\
**Created:** [August 9, 2020, 5:47pm UTC](https://community.transifex.com/t/github-integration-with-nested-files/1986 "2020-08-09T17:47:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lidimayra](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/lidimayra/32/1567_2.png) [@lidimayra](https://community.transifex.com/u/lidimayra)\
**Post date:** [August 9, 2020, 5:47pm UTC](https://community.transifex.com/t/github-integration-with-nested-files/1986/1 "2020-08-09T17:47:17Z")

</div>

I have a Rails project and my translations files follow a structure that’s similar to the project structure itself. Example:

```auto
config/
  locales/
    models/
      en.yml
    views/
      en.yml
    en.yml

```

I would like to understand how can I set my github integration config in order to submit my files to be added according to this structure.

In my attempts, I managed the transifex integration bot to open some PRs to my project like this one: [https://github.com/lidimayra/url-shortener/pull/24](https://github.com/lidimayra/url-shortener/pull/24)

This is an example of an es version of my translations files.

I would like it to be created at `config/locales/views/home.es.yml`  
However, it’s being created at `config/locales/es.yml/views/home.en.yml`

My github integrations configs in transifex look like this:

```auto
filters:
  - filter_type: dir
    # all supported i18n types: https://docs.transifex.com/formats
    file_format: YML
    source_file_extension: yml
    source_language: en
    source_file_dir: /config/locales/LC_MESSAGES
    # path expression to translation files, must contain <lang> placeholder
    translation_files_expression: '/config/locales/<lang>.yml'

```

---

<div class="post-metadata">

**Author:** ![Panagiotis\_Kavrakis](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/panagiotis_kavrakis/32/1402_2.png) [@Panagiotis\_Kavrakis](https://community.transifex.com/u/Panagiotis_Kavrakis)\
**Post date:** [August 12, 2020, 1:00pm UTC](https://community.transifex.com/t/github-integration-with-nested-files/1986/2 "2020-08-12T13:00:19Z")

</div>

Hello @lidimayra,

Thank you for sharing all this information.

I think that your config file should look like the following

```
filters:
  - filter_type: dir
    # all supported i18n types: https://docs.transifex.com/formats
    file_format: YML
    source_file_extension: yml
    source_language: en
    source_file_dir: /config/locales/LC_MESSAGES
    # path expression to translation files, must contain <lang> placeholder
    translation_files_expression: '/config/locales/views/home.<lang>.yml' 

```

Could you please try this and share your feedback with us?

Thank you in advance.

Kind regards,  
Panagiotis

---

<div class="post-metadata">

**Author:** ![lidimayra](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/lidimayra/32/1567_2.png) [@lidimayra](https://community.transifex.com/u/lidimayra)\
**Post date:** [August 12, 2020, 2:03pm UTC](https://community.transifex.com/t/github-integration-with-nested-files/1986/3 "2020-08-12T14:03:34Z")

</div>

Hey @Panagiotis_Kavrakis, thank you for replying!! 🙂

I guess my problem would be that files are located in views directory in this specific scenario, but I would be aiming for a more generic solution.

My yml files follow my Rails project structure:

> **[lidimayra/url-shortener](https://github.com/lidimayra/url-shortener/tree/master/config/locales)**
>
> URL Shortener made with Ruby on Rails and ReactJS. Contribute to lidimayra/url-shortener development by creating an account on GitHub.

So I would like to work with files that could be locate in `views/` or in `models/` or in any other directory inside `config/locales`. Is this possible to be achieved via github integration?

---

<div class="post-metadata">

**Author:** ![Panagiotis\_Kavrakis](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/panagiotis_kavrakis/32/1402_2.png) [@Panagiotis\_Kavrakis](https://community.transifex.com/u/Panagiotis_Kavrakis)\
**Post date:** [August 12, 2020, 3:42pm UTC](https://community.transifex.com/t/github-integration-with-nested-files/1986/4 "2020-08-12T15:42:09Z")

</div>

Hi @lidimayra,

Sorry for the misunderstanding. In that case, unfortunately with DIR as filter\_type what you want is not supported because you have the language code as part of the translation filename and this is not supported. However, if you had the language code as a folder of your path and not part of the filename it could be supported and the config file will have the following format

filters:

- filter\_type: dir  
file\_format: YML  
source\_file\_extension: yml  
source\_language: en  
source\_file\_dir: /config/locales  
translation\_files\_expression: ‘/config/locales//home.yml’

Otherwise, you need to use the **file** option as filter\_type and for each file, you will have a different setting in your config file. An example of that would like the following

filters:

- filter\_type: file  
source\_file:/config/locales/LC\_MESSAGES/views/home.yml  
file\_format: YML  
source\_language: en  
translation\_files\_expression: ‘/config/locales/views/home..yml’

filters:

- filter\_type: file  
source\_file:/config/locales/LC\_MESSAGES/models/home.yml  
file\_format: YML  
source\_language: en  
translation\_files\_expression: ‘/config/locales/models/home..yml’

etc…

Please let me know if that is clear for you now.

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![lidimayra](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/lidimayra/32/1567_2.png) [@lidimayra](https://community.transifex.com/u/lidimayra)\
**Post date:** [August 12, 2020, 7:53pm UTC](https://community.transifex.com/t/github-integration-with-nested-files/1986/5 "2020-08-12T19:53:31Z")

</div>

Got it, it was quite clear. Thank you so much for your time and for the detailed explanation. 🙂
