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

Multiple masterfile support #29

Merged
merged 4 commits into from
Aug 27, 2024
Merged

Multiple masterfile support #29

merged 4 commits into from
Aug 27, 2024

Conversation

simonsmith
Copy link
Member

To allow support for multiple translation files it's necessary for the wti tool to push and pull more than one translation file.

The issue was that the tool always assumed the master file array was one item in length. Instead it now iterates through all the masterfiles and ensures the correct id is selected before making a request to WTI

all the master files

[
  {
    id: 1416083,
    name: 'src/i18n/locales/en/componentA.json',
    created_at: '2024-08-22T13:45:18Z',
    updated_at: '2024-08-22T13:45:18Z',
    hash_file: 'cb30cdf5b74a63869491e248c19af58071f60e5a',
    master_project_file_id: null,
    locale_code: 'en',
    fresh: true
  },
  {
    id: 1417459,
    name: 'src/i18n/locales/en/componentB.json',
    created_at: '2024-08-27T14:48:52Z',
    updated_at: '2024-08-27T14:48:52Z',
    hash_file: '1f217c299d5ffa41d4bfd12558fb95b064bbfe99',
    master_project_file_id: null,
    locale_code: 'en',
    fresh: true
  }
]

project files

[
  {
    "id": 1416090,
    "name": "src/i18n/locales/de-CH/componentA.json",
    "created_at": "2024-08-22T13:45:18Z",
    "updated_at": "2024-08-22T13:55:54Z",
    "hash_file": "e01cf7a990e02b97e4902b37ed8b756522d98a5b",
    "master_project_file_id": 1416083, // <------------- match this to the relevant master file 
    "locale_code": "de-CH",
    "fresh": true
  },
  {
    "id": 1417465,
    "name": "src/i18n/locales/de-CH/componentB.json",
    "created_at": "2024-08-27T14:48:52Z",
    "updated_at": "2024-08-27T14:49:32Z",
    "hash_file": "1b864c8ef0bdc074b835c88fcdbae11405933661",
    "master_project_file_id": 1417459, // <------------- match this to the relevant master file 
    "locale_code": "de-CH",
    "fresh": true
  },
  // --- more items
]

@simonsmith simonsmith force-pushed the multiple-masterfile branch from 8618c92 to 7209b5f Compare August 27, 2024 19:59
@simonsmith simonsmith merged commit 8535abf into master Aug 27, 2024
3 checks passed
@simonsmith simonsmith deleted the multiple-masterfile branch August 27, 2024 20:02
Copy link

🎉 This PR is included in version 2.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

@joostm020 joostm020 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants