Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Liste fields are not translatable atm. We should provide some field and filter handler to fix this. There are some API functions in i18n_field to do that.
Comment | File | Size | Author |
---|---|---|---|
#7 | i18nviews_translate_list_fields_1241514.patch | 2.6 KB | mindgame |
#4 | translate-list-fields-in-filters-1241514-4-D7.patch | 2.73 KB | webflo |
#3 | translate-list-fields-in-filters-1241514-D7.patch | 2.33 KB | webflo |
Comments
Comment #1
webflo CreditAttribution: webflo commentedComment #2
vasikei can confirm this
Comment #3
webflo CreditAttribution: webflo commentedHere is a patch. This patch provides a translated filter handler for each field.
Comment #4
webflo CreditAttribution: webflo commentedComment #5
vasikei had no success with #4 solution. nothing seems to be changed.
Comment #6
irishdan CreditAttribution: irishdan commentedsubscribe
Comment #7
mindgame CreditAttribution: mindgame commentedI have rewritten the patch using hook_field_views_data_alter() because hook_field_views_data() was never called.
Also I changed get_value_options() in i18nviews_handler_filter_field_list.inc to translate the allowed values before calling list_allowed_values() as it is done in i18n_field.module, i18n_field_field_widget_form().
Works for me.
Comment #8
webflo CreditAttribution: webflo commentedYeah looks good. Uploaded the wrong patch.
Comment #9
vasikethe solution from #7 worked for me too.
Comment #10
R13ose CreditAttribution: R13ose commentedI have tried the solution in #7 and this works for me as well.
Comment #11
webflo CreditAttribution: webflo commentedi18n Views does not override existing views handlers. i18 Views implements new handlers with multilingual capabilities.
Comment #12
webflo CreditAttribution: webflo commentedFixed. Commit edc68d1 on 7.x-3.x.
@ mindgame: list_allowed_values() has a static cache. You should not pass translated options to this function. Once you pushed translated options to this function, its impossible to get untranslated field values or translated field values for other languages.
Comment #13
vasikei re-open the issue. there's no success to Translate list fields, in my case List (integer) field.
Comment #14
vasikeComment #15
webflo CreditAttribution: webflo commentedComment #16
webflo CreditAttribution: webflo commented@vasike: Please provide a views export.