I'm using the last views-6.x-3.x-dev and last i18nviews-6.x-3.x without any patch. I translated my views header in translate interface(views section), but when my views page is displayed, the translation of my views header is not handled(didn't try with footer). It was working correctly in 2.x.

PS: my nodes(title/body) and taxonomy term/description are correctly translated in views in display page and views in panels.

Comments

dawehner’s picture

Project: Views (for Drupal 7) » Internationalization Views

The translate function is called. So this seems to be a bug of i18nviews.

Perhaps you just used the preview functionality, there the text isn't translated.

heyyo’s picture

How could I help to debug this issue ?

I change my views-view.tpl.php to add a t() around $header but nothing changed.
The title of the views page is correctly localized.

miro_dietiker’s picture

Priority: Normal » Major

If you like to use the localization from i18nviews you need to switch the views settings:
Visit: admin/build/views/tools
Translation method:
- Views translation module

I just added this to the .install file in CVS. So no further confusion will occur.
Also changed the name of the Module to appear as "Internationalization Views" in views tool translation method settings.

However while testing we finally found out that the current implementation is completely broken:
#1008358: save_locale_strings produces different keys than translate_string

As soon as views 3 implements a clean API we'll update our side again.

heyyo’s picture

Thanks for the update.
By using the last dev I could translate my views header now with core and Internationalization Views.
But with Internmationalization Views method, my page title and breadcrumb are not localized anymore, so for the moment I keep Core method, but I still didn't understand how we translate with Internationalization Views(without localization client of course) stil translation interface ?

miro_dietiker’s picture

With the translation interface.
A new text group "Views" is being defined.

miro_dietiker’s picture

Fixed a first part.
We're now awaiting the completion and commit of
#1008358: save_locale_strings produces different keys than translate_string

In a first version we won't be able to translate header, footer and empty text - because they have an attached format and views currently don't expose them as translateable.

datarazor’s picture

Just checking that my issue is the same as what is described here:

I have i18 and i18Views, I can see translation terms for the header and title when I search for terms in:

/admin/build/translate/search

I can enter a translation.

However these translations are then ignored and not displayed when I switch language on the site, it remains with the default [English] term I have typed in the header/title.

Thanks for any advice you can give on how to resolve this.

Best,

Seb.

datarazor’s picture

Ok, did further testing, still can't find out why in the .module that the translation is not being called, but I can confirm that the Views title IS being translated, just NOT the header or footer of a view. I have the latest version of Views 6.x-2.12, i86 6.x-1.7 , i86Views 6.x-2.0 and Drupal 6.20.

EDIT: will this even work in version i86Views 6.x-2.0? I just noticed this bug is for 3.x-dev...?

miro_dietiker’s picture

Amazing update.

Views 3 (Drupal 6) just committed the localization api cleanup. We're happy to see i18nviews working now.

Currently you still need to "refresh translation" (admin/build/translate/refresh) to make views translations available.
So there will be still followups for improvement.

miro_dietiker’s picture

Status: Active » Fixed

At least our part is fixed then.

heyyo’s picture

Great news ! Will try it shortly.

heyyo’s picture

I have installed the last Views and last i18nviews. I then switched to Internationalization Views in views settings for translation.
When i did a refresh for Views string in translate interface I get this error:

Fatal error: Call to a member function unpack_translatables() on a non-object in /home/3u4u/domains/xxxx.com/prod/sites/all/modules/views/plugins/views_plugin_localization.inc on line 139
miro_dietiker’s picture

You really need latest i18nviews dev and views dev.

However in general this is a views related issue... I don't believe we're direct source of this.

heyyo’s picture

it is last dev from this morning...

miro_dietiker’s picture

Really, rechecked, works as designed... So remains in state fixed.

Please retest in a clean drupal. Are you doing strange modifications? ;-)

heyyo’s picture

I rechecked, not on a fresh website, I have the following in /admin/reports/updates/list

Internationalization 6.x-1.7
Internationalization Views 6.x-3.x-dev (2011-janv.-15)
Views 6.x-3.x-dev (2011-janv.-19)

Do I need also dev version for Internationalization ?

I'm not a real coder, just a simple patcher :-), so nothing special in my modules...

Reported on views issues: http://drupal.org/node/1032836

miro_dietiker’s picture

Note that if your output language is the site default language, then i18n translation is deactivated by default.

You need to enable translation layer for this specific default language.

heyyo’s picture

How do I enable this translation layer for the specific default language ? By specifying a path(domain) prefix for this language ?
Or any other alternative(not really good for my seo)

miro_dietiker’s picture

This is from the inline docs, also available online:

221	/**
222	 * Check if translation is required for this language code.
223	 * 
224	 * Translation is required when default language is different from the given
225	 * language, or when default language translation is explicitly enabled.
226	 *
227	 * No UI is provided to enable translation of default language. On the other
228	 * hand, you can enable/disable translation for a specific language by adding
229	 * the following to your settings.php
230	 *
231	 * @code
232	 *   // Enable translation of specific language. Language code is 'xx'
233	 *   $conf['i18nstrings_translate_langcode_xx'] = TRUE;
234	 *   // Disable translation of specific language. Language code is 'yy'
235	 *   $conf['i18nstrings_translate_langcode_yy'] = FALSE;
236	 * @endcode
237	 */
238	function i18nstrings_translate_langcode($langcode) {

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.