Skip to content

Commit a8ebed6

Browse files
committed
upload: Change UI to frontend
This aligns with changes to OBS Studio.
1 parent 59e3c46 commit a8ebed6

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/upload.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ export async function upload(changedFiles: string[], submoduleName?: string): Pr
106106
directoryId: await getDirId('Plugins'),
107107
exportOptions: { exportPattern: '/plugins/%file_name%/data/locale/%locale%.ini' }
108108
});
109-
} else if (/^UI\/frontend-plugins\/.*\/data\/locale$/.test(PATH.parse(filePath).dir)) {
109+
} else if (/^frontend\/plugins\/.*\/data\/locale$/.test(PATH.parse(filePath).dir)) {
110110
await sourceFilesApi.createFile(PROJECT_ID, {
111111
name: `${pathParts[2]}.ini`,
112112
storageId: await storageId(),
113113
directoryId: await getDirId('Frontend'),
114-
exportOptions: { exportPattern: '/UI/frontend-plugins/%file_name%/data/locale/%locale%.ini' }
114+
exportOptions: { exportPattern: '/frontend/plugins/%file_name%/data/locale/%locale%.ini' }
115115
});
116116
} else {
117117
ACTIONS.error(`${filePath} not uploaded to Crowdin due to its unexpected location. This may be intended.`);

tests/upload.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ const noticeMock = jest.spyOn(ACTIONS, 'notice').mockImplementation(() => {});
1313

1414
it(`${upload.name} (main repo)`, async () => {
1515
MOCK_FS({
16-
'UI/data/locale/en-US.ini': '\n# Comment"\nYes="Yes"\nCancel="Cancel"\n',
17-
'UI/frontend-plugins/some-frontend/data/locale/en-US.ini': 'MyFrontendString="Text"',
16+
'frontend/data/locale/en-US.ini': '\n# Comment"\nYes="Yes"\nCancel="Cancel"\n',
17+
'frontend/plugins/some-frontend/data/locale/en-US.ini': 'MyFrontendString="Text"',
1818
'plugins/sndio/data/locale/en-US.ini': 'Device="Device"\nRate="Rate"\n',
1919
'plugins/my-plugin/data/locale/en-US.ini': 'MyPluginString="Text"',
2020
'plugins/data/locale/en-US.ini': '123'
@@ -53,7 +53,7 @@ it(`${upload.name} (main repo)`, async () => {
5353
exportPattern: '/%file_name%/data/locale/%locale%.ini'
5454
},
5555
id: 29,
56-
name: 'UI.ini'
56+
name: 'frontend.ini'
5757
}
5858
},
5959
{
@@ -85,7 +85,7 @@ it(`${upload.name} (main repo)`, async () => {
8585
directoryId: 136,
8686
name: 'some-frontend.ini',
8787
exportOptions: {
88-
exportPattern: '/UI/frontend-plugins/%file_name%/data/locale/%locale%.ini'
88+
exportPattern: '/frontend/plugins/%file_name%/data/locale/%locale%.ini'
8989
}
9090
})
9191
.reply(201)
@@ -115,16 +115,16 @@ it(`${upload.name} (main repo)`, async () => {
115115
const errorMock = jest.spyOn(ACTIONS, 'error').mockImplementation(() => {});
116116

117117
await upload([
118-
'UI/data/locale/en-US.ini',
118+
'frontend/data/locale/en-US.ini',
119119
'AUTHORS',
120-
'UI/frontend-plugins/some-frontend/data/locale/en-US.ini',
120+
'frontend/plugins/some-frontend/data/locale/en-US.ini',
121121
'plugins/my-plugin/data/locale/en-US.ini',
122122
'plugins/data/locale/en-US.ini',
123123
'plugins/removed/data/locale/en-US.ini'
124124
]);
125125

126-
expect(noticeMock).toBeCalledWith('UI/data/locale/en-US.ini updated on Crowdin.');
127-
expect(noticeMock).toBeCalledWith('UI/frontend-plugins/some-frontend/data/locale/en-US.ini uploaded to Crowdin.');
126+
expect(noticeMock).toBeCalledWith('frontend/data/locale/en-US.ini updated on Crowdin.');
127+
expect(noticeMock).toBeCalledWith('frontend/plugins/some-frontend/data/locale/en-US.ini uploaded to Crowdin.');
128128
expect(noticeMock).toBeCalledWith('plugins/my-plugin/data/locale/en-US.ini uploaded to Crowdin.');
129129
expect(noticeMock).toBeCalledWith('plugins/removed/data/locale/en-US.ini removed from Crowdin.');
130130
expect(errorMock).toBeCalledWith(

0 commit comments

Comments
 (0)