Skip to content

Translation from edit on element#670

Open
alexangelov14 wants to merge 12 commits intomasterfrom
#564-translation-on-element-level
Open

Translation from edit on element#670
alexangelov14 wants to merge 12 commits intomasterfrom
#564-translation-on-element-level

Conversation

@alexangelov14
Copy link
Collaborator

This is related to issue #564

This is related to issue #564
@github-actions
Copy link

github-actions bot commented Nov 5, 2025

🎉 Beta deployment successful!: view the changes in live preview environment: https://gridbeta-github.asterics-foundation.org/alexangelov14/-564-translation-on-element-level/pr

Since it was related to translation decided to add the solution to this problem here. This is a referance to which problem im referencing since it didnt have linked issue number:

Problem: Currently, to "get" all content of a grid set one has to go to 'translate grid', choose the 'show all grids' from the first dropdown and then use the 'copy column' option to get the words.
@github-actions
Copy link

github-actions bot commented Nov 6, 2025

🎉 Beta deployment successful!: view the changes in live preview environment: https://gridbeta-github.asterics-foundation.org/alexangelov14/-564-translation-on-element-level/pr

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

🎉 Beta deployment successful!: view the changes in live preview environment: https://gridbeta-github.asterics-foundation.org/alexangelov14/-564-translation-on-element-level/pr

@github-actions
Copy link

🎉 Beta deployment successful!: view the changes in live preview environment: https://gridbeta-github.asterics-foundation.org/alexangelov14/-564-translation-on-element-level/pr

@github-actions
Copy link

🎉 Beta deployment successful!: view the changes in live preview environment: https://gridbeta-github.asterics-foundation.org/alexangelov14/-564-translation-on-element-level/pr

@github-actions
Copy link

github-actions bot commented Dec 5, 2025

🎉 Beta deployment successful!: view the changes in live preview environment: https://gridbeta-github.asterics-foundation.org/alexangelov14/-564-translation-on-element-level/pr

1 similar comment
@github-actions
Copy link

github-actions bot commented Dec 5, 2025

🎉 Beta deployment successful!: view the changes in live preview environment: https://gridbeta-github.asterics-foundation.org/alexangelov14/-564-translation-on-element-level/pr

Since we moved the translation to the "General" tab its pointless to keep it.
@github-actions
Copy link

github-actions bot commented Dec 5, 2025

🎉 Beta deployment successful!: view the changes in live preview environment: https://gridbeta-github.asterics-foundation.org/alexangelov14/-564-translation-on-element-level/pr

@alexangelov14
Copy link
Collaborator Author

alexangelov14 commented Dec 5, 2025

@klues for some reason it doesnt reflect on the new changes when it builds the pr. Any ideas what may be the case for that?

EDIT: there wasnt any issue. It happened to be a caching problem on my side.

…ation

Switched the position of the accordions "Advanced options" and "Translation". Also in the "Translation" accordion made it so that when there is no other language used by the user to default to the first one in the all languages list.
@github-actions
Copy link

🎉 Beta deployment successful!: view the changes in live preview environment: https://gridbeta-github.asterics-foundation.org/alexangelov14/-564-translation-on-element-level/pr

@github-actions
Copy link

🎉 Beta deployment successful!: view the changes in live preview environment: https://gridbeta-github.asterics-foundation.org/alexangelov14/-564-translation-on-element-level/pr

Copy link
Contributor

@klues klues left a comment

Choose a reason for hiding this comment

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

Thanks for your work! 👍
Please look at my comments.

"clone": "Duplizieren",
"export": "Exportieren",
"exportElementLabels": "Element-Beschriftungen exportieren",
"exportLabelsDescription": "Exportieren Sie alle Element-Beschriftungen aus Ihren Grids als einfache Textdatei. Dies ist nützlich, um einen Überblick über Ihr Vokabular zu erhalten oder für externe Verarbeitung.",
Copy link
Contributor

Choose a reason for hiding this comment

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

has nothing to do with the current issue/PR, has it? It's an interesting idea, but do you have any user request regarding this feature? All regarding this exportLabels functionality should be removed from this PR and added/discussed in another issue/PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

there shouldn't be any changes to languages files except i18n.en.json - all other languages are managed via crowdin.

getLabelPlaceholder(locale) {
// If LIVE element, show special placeholder
if (this.gridElement.type === GridElement.ELEMENT_TYPE_LIVE) {
return i18nService.t('canIncludePlaceholderLike');
Copy link
Contributor

Choose a reason for hiding this comment

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

this breaks something.
Normally the placeholder for live elements looks like this:
image
now looks like this:
image
so it's now interpreting the placeholders which should be visible in the text as actual placeholders for data.

Copy link
Contributor

Choose a reason for hiding this comment

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

probably needs some adaption in i18nService.t() to not pass params?! I don't know.

Copy link
Contributor

Choose a reason for hiding this comment

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

this is still broken. For live elements the placeholder should tell the user that the text can include a placeholder like {0}, now it only says text (Spanish) or similar. Go to "new special element -> Live element" to see it.
I would use just (Spanish) for the normal placeholders not text (Spanish), but probably a thing of personal preference.

return i18nService.t('canIncludePlaceholderLike');
}

// If label exists in requested locale, no placeholder needed
Copy link
Contributor

Choose a reason for hiding this comment

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

can be removed - if there is a value, we don't see the placeholder

}

// Find first available label in another language
let availableLangs = Object.keys(this.gridElement.label).filter(lang => this.gridElement.label[lang]);
Copy link
Contributor

Choose a reason for hiding this comment

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

can also be removed, see comment in issue. Basically just always show Text ([current content lang])

}
},
mounted() {
// Ensure gridElement has proper label and pronunciation structure
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, I don't think we really need this - I think we can trust that label and pronunciation is an object here. See GridElement.DEFAULTS in GridElement.js

margin-top: 1em;
}

.input-button {
Copy link
Contributor

Choose a reason for hiding this comment

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

gridTranslateModal.vue has a very similar CSS rule for the pronunciation play button. please unify and add it to some common CSS like custom.css or even better: extract the input field + play button to an extra component and use it here twice and in translate modal once.

pointer-events: auto;
}

.checkbox-label-small {
Copy link
Contributor

Choose a reason for hiding this comment

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

the select for the languages + show all languages checkbox should also be moved to an extra component and used everywhere, to prevent doing the same things (like computing currently shown languages etc.) at so many places.
But only do it if you want - since it's probably some work to do it everywhere...

Copy link
Contributor

Choose a reason for hiding this comment

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

as said in other comment - should be included in this PR - is a separate issue / PR

padding: 0 1em;
box-shadow: none;
background-color: transparent;
cursor: pointer;
Copy link
Contributor

Choose a reason for hiding this comment

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

aren't these default values for buttons? so I don't understand why we need these changes.

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

🎉 Beta deployment successful!: view the changes in live preview environment: https://gridbeta-github.asterics-foundation.org/alexangelov14/-564-translation-on-element-level/pr

@alexangelov14
Copy link
Collaborator Author

alexangelov14 commented Jan 6, 2026

@klues can you check if i havent missed something from the comments. The stuff regarding the export labels was requested by ms-mialingvo from what i remember. It was talked somewhere in the comments of the issue itself, if im not wrong.

https://gridbeta-github.asterics-foundation.org/alexangelov14/-564-translation-on-element-level/pr

@alexangelov14
Copy link
Collaborator Author

@klues can you check the last changes whenever possible?

@alexangelov14
Copy link
Collaborator Author

@klues could you please check out the latest changes and give me some feedback if needed?

"clone": "Clone",
"export": "Export",
"exportElementLabels": "Export element labels",
"exportLabelsDescription": "Export all element labels from your grids as a simple text file. This is useful for getting an overview of your vocabulary or for external processing.",
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove all new labels which are not related to the current issue.

<div class="row">
<label class="col-sm-2" for="inputLabel">{{ $t('label') }}</label>
<div class="col-sm-7">
<input type="text" class="col-12" id="inputLabel" v-focus @keydown.enter.exact="$emit('searchImage')" v-if="gridElement" v-model="gridElement.label[currentLang]" :placeholder="gridElement.type === GridElement.ELEMENT_TYPE_LIVE ? $t('canIncludePlaceholderLike') : ''"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

here you removed the logic for the special placeholder if it's a live element - should be included in "getLabelPlaceholder()"

let langName = this.getLocaleTranslation(locale);
return `${i18nService.t('text')} (${langName})`;
},
getPronunciationPlaceholder(locale) {
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like this method is never used

let label = this.gridElement.label[locale] || '';
let langName = this.getLocaleTranslation(locale);
if (label) {
return `${langName} pronunciation of "${label}"`;
Copy link
Contributor

Choose a reason for hiding this comment

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

still open

if (label) {
return `${langName} pronunciation of "${label}"`;
}
return `${langName} pronunciation`;
Copy link
Contributor

Choose a reason for hiding this comment

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

still open

return `${langName} pronunciation`;
},
getLocaleTranslation(locale) {
return i18nService.getTranslationAppLang(this.allLanguages.filter((lang) => lang.code === locale)[0]);
Copy link
Contributor

Choose a reason for hiding this comment

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

still open

@klues
Copy link
Contributor

klues commented Feb 9, 2026

Hi, I've added another review with some new comments. There are also many comments from my previous review, which were not adressed.

In addition to changing something in the code, please also reply to all of my comments (also "ok, done" is helpful) - so it's easier for me to see what you have done or changed.

@github-actions
Copy link

github-actions bot commented Feb 9, 2026

🎉 Beta deployment successful!: view the changes in live preview environment: https://gridbeta-github.asterics-foundation.org/alexangelov14/-564-translation-on-element-level/pr

@alexangelov14
Copy link
Collaborator Author

@klues went through all of the comments from Dec 18th and the new ones today. All the things should be addressed from my understanding. Nothing should've been missed. The only thing skipped is the part for "the select for the languages + show all languages checkbox" which was optional for now. Seems kinda pointless at this point to go through all of the comments and say the I've done them since thats what I'm saying here in this one. Will keep it in mind for other tasks/issues tho.

https://gridbeta-github.asterics-foundation.org/alexangelov14/-564-translation-on-element-level/pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments