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 errors saving dropdown option translations #2513

Merged
merged 4 commits into from
Jun 25, 2024
Merged
Changes from 1 commit
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
Next Next commit
fix parsing of option translation locale
  • Loading branch information
cairocoder01 committed Jun 6, 2024
commit 2afd710d3ba4fc08e4d82e8361c03064c1e1c2b3
3 changes: 2 additions & 1 deletion dt-core/admin/js/dt-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,8 @@ jQuery(document).ready(function ($) {
$(tr)
.find("input[id^='" + option_key_prefix + "']")
.each(function (okt_idx, okt_input) {
let locale = window.lodash.split($(okt_input).attr('id'), '-')[1];
// expected format: field_option_{option_value}_translation-{locale}
let locale = okt_input.id.replace(option_key_prefix, '');
let value = $(okt_input).val();
if (locale && value) {
translations['option_translations'].push({
Expand Down