# Existing translations not fetched with github integration

**URL:** <https://community.transifex.com/t/existing-translations-not-fetched-with-github-integration/2692>\
**Category:** Q&A\
**Tags:** integrations, github\
**Created:** [February 21, 2022, 11:17am UTC](https://community.transifex.com/t/existing-translations-not-fetched-with-github-integration/2692 "2022-02-21T11:17:07Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![rhiaro](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@rhiaro](https://community.transifex.com/u/rhiaro)\
**Post date:** [February 21, 2022, 11:17am UTC](https://community.transifex.com/t/existing-translations-not-fetched-with-github-integration/2692/1 "2022-02-21T11:17:07Z")

</div>

Hello, I’ve configured the github integration on a project which already contains partial translations for some languages in the github repo, as `po` files. I made a new transifex project to test it out. The source files are synced okay, but the translations aren’t there. Should transifex have automatically picked these up and I’m doing something wrong, or is that not expected behaviour?

In case it helps my config looks like (and I verified the path to the translation files is correct):

```auto
filters:
  - filter_type: dir
    file_format: PO
    source_file_extension: pot
    source_language: en
    source_file_dir: docs/locale/en/LC_MESSAGES/
    translation_files_expression: 'docs/locale/<lang>/LC_MESSAGES/'
settings:
    pr_branch_name: tx_translations_<br_unique_id>

```

Edit: is it a problem that the source files are `pot` and the translation files are `po` extension? If I change the extension to `po` I get “Error while uploading translation: ‘Not found’” for every single translation file, and none of the source files show. It is looking in the right place for `po` files which do exist, though.

Thanks!

---

<div class="post-metadata">

**Author:** ![rhiaro](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@rhiaro](https://community.transifex.com/u/rhiaro)\
**Post date:** [February 21, 2022, 8:26pm UTC](https://community.transifex.com/t/existing-translations-not-fetched-with-github-integration/2692/2 "2022-02-21T20:26:07Z")

</div>

Further testing and I can see that it’s making the PRs with translations to `.pot` files when they should be `.po` files, so I think this discrepancy must have something to do with it…

I tried changing the source files to `.po`, but that didn’t help with finding the existing translations.

---

<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:** [February 22, 2022, 9:14am UTC](https://community.transifex.com/t/existing-translations-not-fetched-with-github-integration/2692/3 "2022-02-22T09:14:07Z")

</div>

Hello @rhiaro ,

Thank you for reaching out to the Transifex community.

Could you please share with us the URL of your test project, in order to test this out?  
Also, you can reach out to us via email at [support@transifex.com](mailto:support@transifex.com) in order to continue the discussion from there.

Looking forward to your response.

Kind regards,  
Panagiotis

---

<div class="post-metadata">

**Author:** ![rhiaro](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@rhiaro](https://community.transifex.com/u/rhiaro)\
**Post date:** [February 22, 2022, 9:57am UTC](https://community.transifex.com/t/existing-translations-not-fetched-with-github-integration/2692/4 "2022-02-22T09:57:31Z")

</div>

Thanks for your reply @Panagiotis_Kavrakis, the test project is [BODS test localization](https://www.transifex.com/OpenDataServices/bods-test/). I can send an email, but I’m happy to continue here so that the responses can help others who are searching similar problems in the future.

---

<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:** [February 24, 2022, 12:13pm UTC](https://community.transifex.com/t/existing-translations-not-fetched-with-github-integration/2692/5 "2022-02-24T12:13:02Z")

</div>

Hello @rhiaro ,

Thank you for your response. I will have a further look into this and I will let you know as soon as possible.

Kind regards,  
Panagiotis

---

<div class="post-metadata">

**Author:** ![Cesar\_Garcia](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/cesar_garcia/32/1745_2.png) [@Cesar\_Garcia](https://community.transifex.com/u/Cesar_Garcia)\
**Post date:** [February 24, 2022, 3:48pm UTC](https://community.transifex.com/t/existing-translations-not-fetched-with-github-integration/2692/6 "2022-02-24T15:48:40Z")

</div>

Hello @rhiaro ,

Let me chime in here since Panagiotis is out of the office.  
Basing on your initial query I assume your PO files (translations) contains some strings translated and some others are empty, PO format does not allow partial translations meaning that you either have all of them filled or all of them empty.

e.g.  
PO file fromat:

msgid “Next”  
msgstr “Next”  
msgid “Done”  
msgstr “Done”

POT file format:  
msgid “Next”  
msgstr “”  
msgid “Done”  
msgstr “”

If this is not clear perhaps you could share your PO file with us so we can go over it and point out the root cause 🙂  
Best Regards  
Cesar

---

<div class="post-metadata">

**Author:** ![rhiaro](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@rhiaro](https://community.transifex.com/u/rhiaro)\
**Post date:** [March 2, 2022, 9:49am UTC](https://community.transifex.com/t/existing-translations-not-fetched-with-github-integration/2692/7 "2022-03-02T09:49:18Z")

</div>

Thanks @Cesar_Garcia. Most, if not all, of the files in one language are fully translated: [data-standard/docs/locale/ru/LC\_MESSAGES at master · openownership/data-standard · GitHub](https://github.com/openownership/data-standard/tree/master/docs/locale/ru/LC_MESSAGES/)

This also doesn’t explain the problem with the file extension. I understand it is normal to use `.pot` for the source files, and `.po` for the translated files. So should I put `pot` or `po` as the value for `source_file_extension` in the config? If I use `.pot` (which is the extension for the source files) then when the github integration makes a PR with new translations (for a fully translated resource), it creates `.pot` files for the translations, which should not be the case, especially as there are existing `.po` files in the repo.

---

<div class="post-metadata">

**Author:** ![Cesar\_Garcia](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/cesar_garcia/32/1745_2.png) [@Cesar\_Garcia](https://community.transifex.com/u/Cesar_Garcia)\
**Post date:** [March 3, 2022, 5:15pm UTC](https://community.transifex.com/t/existing-translations-not-fetched-with-github-integration/2692/8 "2022-03-03T17:15:33Z")

</div>

Hello Rhiaro,

I hope you are doing great!

I believe there is a misunderstanding on how the integrations works,  
I noticed that on your initial query you pasted your YAML config and you are using :

- filter\_type: dir

By using this option Transifex will get the file name + extension and will use it on your translation files, POT is just a structure template of the PO file format, Now, You can use PO for source or POT that is really up to you just keep in mind that while using file\_type dir you wont be able to change or customize your file name or its format.

Using the below YAML config I get a POT file for source and a POT file return as a translation and as you can see I added the extension next to the variable “lang”  
git:  
filters:

- filter\_type: file  
file\_format: PO  
source\_file: locale/test.pot  
source\_language: en  
translation\_files\_expression: ‘.pot’

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/transifex/original/2X/0/00125e16a6c71a9b22b67277c07cd92fcfa510b0.png)

Let me know if the above answers your question 🙂  
Best Regards  
Cesar

---

<div class="post-metadata">

**Author:** ![rhiaro](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@rhiaro](https://community.transifex.com/u/rhiaro)\
**Post date:** [March 3, 2022, 5:35pm UTC](https://community.transifex.com/t/existing-translations-not-fetched-with-github-integration/2692/9 "2022-03-03T17:35:35Z")

</div>

> By using this option Transifex will get the file name + extension

Get from where?

I think I must use `filter_type: dir` because there are many resources to translate across many files, not only one file, correct?

I’m very sorry I don’t really understand your reply. What configuration do I need for:

- a github repo that already has translations, where
- I want the first sync to fetch the existing translations into transifex;
- the source files have `.pot` extensions,
- and the translation files have `.po` extensions;
- and subsequent translations/changes in transifex should be made as PRs against the corresponding translation `.po` files that are already in the repo?

Thanks again for your help.

---

<div class="post-metadata">

**Author:** ![Cesar\_Garcia](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/cesar_garcia/32/1745_2.png) [@Cesar\_Garcia](https://community.transifex.com/u/Cesar_Garcia)\
**Post date:** [March 3, 2022, 8:47pm UTC](https://community.transifex.com/t/existing-translations-not-fetched-with-github-integration/2692/10 "2022-03-03T20:47:21Z")

</div>

Hello,

I apologize for the delay, I was doing some testing in one my projects and this is what I found:  
Using the following YML configuration and having POT as source and PO as translation, Im able to send all files (source & translations) to Transifex successfully this is only from GH to TX  
git:  
filters:  
- filter\_type: dir  
file\_format: PO  
source\_file\_extension: pot  
source\_language: en  
source\_file\_dir: SourceFiles  
translation\_files\_expression: ‘Translations//’

Now, For the second sync Transifex will return translation files as POT and here is what I meant by “Transifex will get the file name + extension” from your source files. Im not completely sure this is the right behavior and I keep looking into this with the relevant team as working from the UI you can upload a POT as source and you will get a PO in return as a translation download. so, In the mean time in order to avoid loosing more time, is it possible for you to upload all your source files as PO ?

Thanks in advance  
Cesar

---

<div class="post-metadata">

**Author:** ![Ryan](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/ryan/32/1868_2.png) [@Ryan](https://community.transifex.com/u/Ryan)\
**Post date:** [November 10, 2022, 1:57pm UTC](https://community.transifex.com/t/existing-translations-not-fetched-with-github-integration/2692/11 "2022-11-10T13:57:58Z")

</div>

Hi,

A fix was implemented to make sure that translation files for .pot source files will always have a .po extension instead of .pot. So, what this means is that you can use either .po or .pot source files now and always get back translation files with a .po extension.

Regards,  
Ryan  
Transifex Support
