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

fix(translations): use lexical block folder prefix from config #223

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions plugin/src/lib/api/payload-crowdin-sync/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ export class payloadCrowdinSyncTranslationsApi {
localeMap: PluginOptions["localeMap"];
sourceLocale: PluginOptions["sourceLocale"];
htmlToSlateConfig: PluginOptions["htmlToSlateConfig"];
disableSelfClean?: PluginOptions["disableSelfClean"]
lexicalBlockFolderPrefix: PluginOptions["lexicalBlockFolderPrefix"];
disableSelfClean?: PluginOptions["disableSelfClean"];

constructor(pluginOptions: PluginOptions, payload: Payload) {
// credentials
Expand All @@ -92,6 +93,7 @@ export class payloadCrowdinSyncTranslationsApi {
this.sourceLocale = pluginOptions.sourceLocale;
this.htmlToSlateConfig = pluginOptions.htmlToSlateConfig
this.disableSelfClean = pluginOptions.disableSelfClean
this.lexicalBlockFolderPrefix = pluginOptions.lexicalBlockFolderPrefix || ``
}

async updateTranslation({
Expand Down Expand Up @@ -404,7 +406,7 @@ export class payloadCrowdinSyncTranslationsApi {
const lexicalFieldCrowdinArticleDirectory = await getLexicalFieldArticleDirectory({
payload: this.payload,
parent: file.crowdinArticleDirectory,
name: `lex.${fieldName}`,
name: `${this.lexicalBlockFolderPrefix}${fieldName}`,
})
const lexicalFieldCrowdinArticleDirectoryId = getRelationshipId(lexicalFieldCrowdinArticleDirectory as any)

Expand Down
Loading