Active
Project:
Page Title
Version:
7.x-2.7
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Jul 2012 at 20:56 UTC
Updated:
30 Sep 2014 at 14:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Tony Sharpe commentedI also need D7 version multi-language support for page title patterns, as in D6 thread http://drupal.org/node/383358. Any thoughts on this?
Comment #2
adelka commentedMeanwhile, I found solution.
I used this php snippet for each word I needed to be multilingual:
Of couse, its not very flexible (if you have many languages or you plan to add more later) but its solution for now.
Comment #3
Goekmen commentedThanks... your solution helped me out!
Comment #4
matulis commentedHere is my use case for mulitlingual site with 2 languages - EN / FR.
I needed multilingual pattern for content type : News (Actualité), machine name = news.
1. Install module : Variable
2. in custom module implement hook
Inspect pattern input name in admin/config/search/page-title to find out variable name,
for content types it will be 'page_title_type_CONTENTTYPENAME',
for user profile 'page_title_user'.
3. make variable mulitlingual on admin/config/regional/i18n/variable
4. now you can see language switcher on admin/config/search/page-title and define different patterns for each language :
pattern for English version = [current-page:page-title] | News | [site:name]
pattern for French version = [current-page:page-title] | Actualités | [site:name]
Comment #5
jasom commented#4 works perfect for me, tnx matulis.
page_title_vocab_VOCABMACHINENAME for vocabulary page title
page_title_default for default page title
page_title_front for front page title
Comment #6
jasom commentedHere is upload of module based on #4. It's 7.1 edit of module used in my site (have more custom hooks at original one).
In this is 7.1 edit is set multilingual page title for content type page and article, taxonomy tags, default and front page. You will need probably to edit it and add hooks for your content types names and taxonomy names.
Let me know if it works.
Comment #7
i.explose commented@matulis Thanks, this is working perfectly!
@jasom thanks for the file, it's working great!
Comment #8
siliconmind commentedCouldn't we just run the pattern through t() before passing it to token_replace?
This seems to be the least intrusive way of making this module more multilingual friendly. I know it's not very pretty but would be great for a start.
It would also it make sense to invoke token_replace with correct language option. Passing language object to token_replace makes sense because some functions might use LANGUAGE_NONE instead of current site language if language is not provided.
Comment #9
jabberwooki commented#4 works perfect for me too, thanks a lot matulis.
In addition, it's possible to implement hook_variable_group_info()
(see details in variable.api.php which is included in the Variable module)
and so you get your page title settings in their own vertical tab in admin/config/regional/i18n/variable.
For instance, below is what I did :
Comment #10
pravin ajaaz commented@jabberwooki : can you pls explain me how to use that variable tab to translate page title...