Aug 17 2009

CGML – Celogeek Multi Language – Wordpress Plugins

Category: Pluginscelogeek @ 7:39Other Languages: Français

The Plugin

Welcome to CGML plugin homepage.

Here the plugin URL : http://wordpress.org/extend/plugins/cgml/

Changelog

v0.6 : add widget language selector
v0.5 : add version in admin page
v0.4 : add activation in cgml page
v0.3 : Add suffix and prefix in cgml_languages for maximum flexibility.
v0.2 : Fix footer.
v0.1 : Initial version. Allow you to link many blogs together and display flags in posts where you had indicate a translation.

How it work

Take zip file on wordpress website (url on top).
Unpack it under “wp-content/plugins”.
Go to plugin screen.
Activate the plugin.
A new menu appear in “Settings” : CGML.
You can click on “Settings” directly on plugins screen to configure it.
You have to activate the plugin CGML in his setting page after setting done.

Click to enlarge :
cgml_fr_001

Now you can add language. Each one will be identify by a key and an URL. You can also have many languages on the same blog but it’s better to have different instance of wordpress. With different instance, each one can have menu and tags in right language.
Fill the form to add a language.

Flag : This icon will appear on each post and page.
Custom Key : Key use to indicate that a translation is available.
Language label : Title when you pass your mouse over the link.
URL : Link to the blog.

Example for my blog :
Drapeau : French
Custom Key : fr
Label : Français
URL : http://blog.celogeek.fr/

In my french blog :
Flag : English
Custom Key : en
Label : Anglais
URL : http://blog.celogeek.com/

cgml_fr_002

Now to use this on your page or your post, just add a custom key “cgml” and use this value :
custom key:post id

Example :
fr:1071

This will add a french flag (the one with “fr” custom key), with “Français” title and an url like this “http://blog.celogeek.fr?p=1071″.

If you want to add more language, just add other “cgml” custom key

Example :
it:1010

With this example you will add 2 “cgml” custom key, one with “fr:1071″ value and other with “it:1010″ value.

cgml_fr_003

Well, this is perfect but you need one more thing. You have to slightly modify your theme to add the flag system on your page and post.

Generally you have 3 files to change, “index.php”, “page.php” et “single.php”, in fact, all page with an “Edit this”.
Track the place where we show post. Find something like “while (have_posts()): the_posts()”. Find the post headers.
It should be something like “edit_post_link(‘Edit This’)”, just before “</div>” push this :

<?php if (function_exists(‘cgml_languages’)) cgml_languages(get_the_ID(), ‘ &#8212; <span class="cgml_languages">’.__(‘Other Languages’,'cgml’).’:&nbsp;’,'</span>’) ?>

It will call the function that handle flags. It take 2 parameters. First one is the post id. Second one is the prefix. Third one is the suffix. In my case, a dash follow by a span and the “Other Language” already translate in cgml plugin.

cgml_en_004

If you love “widgets”, so you can activate the CGML one :
cgml_en_005

You will have access to many options in order to customize the CGML languages selector.

It’s done !

Celogeek

Save, share and enjoy :

  • Print
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Live
  • MySpace
  • Netvibes
  • PDF
  • RSS
  • Slashdot
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz
  • Digg
  • FriendFeed
  • Technorati
  • Add to favorites
  • BarraPunto
  • Bitacoras.com
  • BlinkList
  • blogmarks
  • Blogosphere News
  • Blogplay
  • blogtercimlap
  • connotea
  • Current
  • Diigo
  • DotNetKicks
  • DZone
  • eKudos
  • email
  • Fark
  • Faves
  • Fleck
  • FSDaily
  • Global Grind
  • Gwar
  • HackerNews
  • Haohao
  • HealthRanker
  • HelloTxt
  • Hemidemi
  • Hyves
  • Identi.ca
  • IndianPad
  • Internetmedia
  • Kirtsy
  • laaik.it
  • LinkaGoGo
  • LinkArena
  • LinkedIn
  • Linkter
  • Meneame
  • MisterWong
  • MisterWong.DE
  • Mixx
  • MSN Reporter
  • muti
  • MyShare
  • N4G
  • Netvouz
  • NewsVine
  • NuJIJ
  • Ping.fm
  • Posterous
  • Propeller
  • Ratimarks
  • Rec6
  • Reddit
  • Scoopeo
  • Segnalo
  • Simpy
  • Socialogs
  • SphereIt
  • Sphinn
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • ThisNext
  • Tipd
  • Tumblr
  • Upnews
  • Webnews.de
  • Webride
  • Wikio
  • Wikio FR
  • Wikio IT
  • Wists
  • Wykop
  • Xerpi
  • Yigg
  • 豆瓣
  • 豆瓣九点
  • Design Float
  • Diggita
  • LaTafanera
  • MOB
  • QQ书签
  • SheToldMe
  • viadeo FR

Tags: , , ,