diff --git a/package.json b/package.json index bc057382..fece301d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tc-create-app", "homepage": "https://create.translationcore.com/", - "version": "1.16", + "version": "1.17", "license": "MIT", "private": false, "bugs": { @@ -35,8 +35,8 @@ "@material-ui/styles": "^4.11.3", "axios": "^0.21.0", "bible-reference-range": "^1.1.0", - "datatable-translatable": "1.2.3", - "dcs-branch-merger": "^1.3.0", + "datatable-translatable": "1.2.4", + "dcs-branch-merger": "1.4.1", "deep-freeze": "^0.0.1", "gitea-react-toolkit": "2.2.4", "lodash.isequal": "^4.5.0", diff --git a/public/build_number b/public/build_number index 79ca276e..601ad778 100644 --- a/public/build_number +++ b/public/build_number @@ -1 +1 @@ -273-2ccee8b +278-e8671df diff --git a/src/components/translatable/Translatable.js b/src/components/translatable/Translatable.js index 1deb4359..cb8f6464 100644 --- a/src/components/translatable/Translatable.js +++ b/src/components/translatable/Translatable.js @@ -55,32 +55,25 @@ function Translatable() { {' '} ); - // console.log("filepathsMatch=", filepathsMatch) - // console.log("sourceFileContent", sourceFileContent) - // console.log("releasedSourceContent", releasedSourceContent) - // console.log("targetFileContent", targetFileContent) if ( filepathsMatch && (sourceFileContent || releasedSourceContent) && targetFileContent ) { + const organizationName = targetRepository?.full_name.split('/')[0]?.toLowerCase(); if (filepath.match(/\.md$/)) { let translatableProps = { - original: sourceFileContent ? sourceFileContent : releasedSourceContent, + original: organizationName === "unfoldingword" ? sourceFileContent:releasedSourceContent, translation: targetFileContent, onTranslation: saveTranslation, onContentIsDirty: setContentIsDirty, translationFontFamily: selectedFont, }; - console.log('Markdown file selected'); _translatable = ; } else if (filepath.match(/\.tsv$/)) { - console.log('TSV file selected'); const onSave = async function (...args) { - console.log("branch-merger: started saving"); const saved = await saveTranslation(...args); - console.log("branch-merger: finished saving"); return saved; } const onEdit = function (...args) { @@ -106,6 +99,7 @@ function Translatable() { saveTranslation, autoSaveOnEdit, selectedFont, + targetRepository.full_name ]); useEffect(() => { diff --git a/src/components/translatable/TranslatableTSV.js b/src/components/translatable/TranslatableTSV.js index 570e3bca..804df879 100644 --- a/src/components/translatable/TranslatableTSV.js +++ b/src/components/translatable/TranslatableTSV.js @@ -58,6 +58,7 @@ export default function TranslatableTSV({ expandedScripture, cachedFile, selectedFont, + targetRepository, }, actions: { setResourceLinks }, giteaReactToolkit: { @@ -66,6 +67,8 @@ export default function TranslatableTSV({ }, } = useContext(AppContext); + const organizationName = targetRepository?.full_name.split('/')[0]?.toLowerCase(); + const { filepath: sourceFilepath, content: sourceContent, @@ -73,12 +76,11 @@ export default function TranslatableTSV({ } = sourceFileHook.state || {}; const { content: targetContent } = targetFileHook.state || {}; const { content: cachedContent } = cachedFile || {}; - // console.log("TranslatableTSV() sourceContent, publishedContent:", sourceContent, releasedSourceContent) const columnNames = useMemo(() => { - const _content = sourceContent || releasedSourceContent; + const _content = organizationName === "unfoldingword" ? sourceContent : releasedSourceContent; const _columnNames = columnNamesFromContent({ content: _content, delimiters }); return _columnNames; - }, [sourceContent, releasedSourceContent]); + }, [sourceContent, releasedSourceContent, organizationName ]); const { actions: { onValidate }, @@ -184,7 +186,7 @@ export default function TranslatableTSV({ ORIGINAL_LANG_POSITION={ORIGINAL_LANG_POSITION} >