Skip to content
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.

Commit

Permalink
I18n : traductions functions.php
Browse files Browse the repository at this point in the history
Initialisation du fichier de traduction : traductions des termes du
fichier functions.php
  • Loading branch information
Luc Poupard committed Apr 10, 2013
1 parent e8fec33 commit ecd5c6c
Show file tree
Hide file tree
Showing 4 changed files with 171 additions and 106 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -154,7 +154,7 @@ pip-log.txt
.tox

#Translations
*.mo
#*.mo

#Mr Developer
.mr.developer.cfg
Expand Down
135 changes: 30 additions & 105 deletions functions.php
@@ -1,82 +1,13 @@
<?php
/**
* ffeeeedd : fonctions du thème
* @author Gaël Poupard
* @link www.ffoodd.fr
*
* @package WordPress
* @subpackage ffeeeedd
* @since ffeeeedd 1.0
*/


/* ========================================================================================================================
Paramètres spécifiques du thème
======================================================================================================================== */

add_theme_support('post-thumbnails');

register_nav_menus(array('primary' => 'Menu principal'));

/* ========================================================================================================================
Actions et Filtres
======================================================================================================================== */

// I18n : déclare le domaine et l'emplacement des fichiers de traduction
add_action( 'after_setup_theme', 'setup' );

function setup() {
load_theme_textdomain('ffeeeedd', get_template_directory() . '/lang');
}

add_action( 'wp_enqueue_scripts', 'base_script_enqueuer' );

// Retire les classes générées - sauf la current - par Wordpress sur le menu principal
add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1);
add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1);
add_filter('page_css_class', 'my_css_attributes_filter', 100, 1);
function my_css_attributes_filter($var) {
return is_array($var) ? array_intersect($var, array('current_page_item', 'current-page-ancestor', 'inbl')) : '';
}

// Désactive les liens et scripts inutiles générés par Wordpress
automatic_feed_links(false);
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0 );
remove_action('wp_head', 'wp_dlmp_l10n_style' );
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');

// Ajoute une classe aux parents dans la navigations
add_filter( 'wp_nav_menu_objects', 'add_menu_parent_class' );
function add_menu_parent_class( $items ) {
$parents = array();
foreach ( $items as $item ) {
if ( $item->menu_item_parent && $item->menu_item_parent > 0 ) {
$parents[] = $item->menu_item_parent;
}
}
foreach ( $items as $item ) {
if ( in_array( $item->ID, $parents ) ) {
$item->classes[] = 'parent';
}
}
return $items;
}
=======
/**
* ffeeeedd : fonctions du thème
* @author Gaël Poupard
* @link www.ffoodd.fr
*
* @package WordPress
* @subpackage ffeeeedd
* @since ffeeeedd 1.0
*/
/**
* ffeeeedd : fonctions du thème
* @author Gaël Poupard
* @link www.ffoodd.fr
*
* @package WordPress
* @subpackage ffeeeedd
* @since ffeeeedd 1.0
*/


/* ========================================================================================================================
Expand All @@ -91,7 +22,6 @@ function add_menu_parent_class( $items ) {


/* ========================================================================================================================
>>>>>>> Harmonisation indentation
Actions et Filtres
Expand All @@ -101,7 +31,7 @@ function add_menu_parent_class( $items ) {
add_action( 'after_setup_theme', 'setup' );

function setup() {
load_theme_textdomain('ffeeeedd', get_template_directory() . '/languages');
load_theme_textdomain('ffeeeedd', get_template_directory() . '/lang');
}

add_action( 'wp_enqueue_scripts', 'base_script_enqueuer' );
Expand Down Expand Up @@ -175,7 +105,6 @@ function add_opengraph_doctype( $output ) {
/**
* Ajouter les scripts et styles via wp_head()
*
* @return void
*/

function base_script_enqueuer() {
Expand Down Expand Up @@ -250,41 +179,41 @@ function myget_category_parents($id, $link = false,$separator = '/',$nicename =
if ($parent->parent && ($parent->parent != $parent->term_id ) && !in_array($parent->parent, $visited)) {
$visited[] = $parent->parent;$chain .= myget_category_parents( $parent->parent, $link, $separator, $nicename, $visited );
}
if ($link) $chain .= '<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="inbl"><a href="' . get_category_link( $parent->term_id ) . '" title="Voir tous les articles de '.$parent->cat_name.'" itemprop="url">'.$name.'</a></li>' . $separator;
if ($link) $chain .= '<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="inbl"><a href="' . get_category_link( $parent->term_id ) . '" title="'. __('Voir tous les articles de', 'ffeeeedd') .' '.$parent->cat_name.'" itemprop="url">'.$name.'</a></li>' . $separator;
else $chain .= $name.$separator;
return $chain;
}

function ariane() {
global $wp_query;$ped=get_query_var('paged');$rendu = '<ol class="print-hidden">';
if ( is_home() ) {$rendu .= '<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="inbl"><a title="'. get_bloginfo('name') .'" href="'.home_url().'" itemprop="url">'. get_bloginfo('name') .'</a></li> &rarr; <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="inbl">Actualité</li>';}
if ( is_home() ) {$rendu .= '<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="inbl"><a title="'. get_bloginfo('name') .'" href="'.home_url().'" itemprop="url">'. get_bloginfo('name') .'</a></li> &rarr; <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="inbl">'. __('Actualité', 'ffeeeedd') .'</li>';}
if ( !is_home() ) {$rendu .= '<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="inbl"><a title="'. get_bloginfo('name') .'" href="'.home_url().'" itemprop="url">'. get_bloginfo('name') .'</a></li>';}
if ( is_category() ) {
$cat_obj = $wp_query->get_queried_object();$thisCat = $cat_obj->term_id;$thisCat = get_category($thisCat);$parentCat = get_category($thisCat->parent);
if ($thisCat->parent != 0) $rendu .= " &rarr; ".myget_category_parents($parentCat, true, " &rarr; ", true);
if ($thisCat->parent == 0) {$rendu .= " &rarr; ";}
if ($thisCat->parent != 0) $rendu .= ' &rarr; '.myget_category_parents($parentCat, true, ' &rarr; ', true);
if ($thisCat->parent == 0) {$rendu .= ' &rarr; ';}
if ( $ped <= 1 ) {$rendu .= single_cat_title("", false);}
elseif ( $ped > 1 ) {
$rendu .= '<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="inbl"><a href="' . get_category_link( $thisCat ) . '" title="Voir tous les articles de '.single_cat_title("", false).'" itemprop="url">'.single_cat_title("", false).'</a></li>';
$rendu .= '<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="inbl"><a href="' . get_category_link( $thisCat ) . '" title="'. __('Voir tous les articles de', 'ffeeeedd') .' '.single_cat_title("", false).'" itemprop="url">'.single_cat_title("", false).'</a></li>';
}
}
elseif ( is_author()){
global $author;$user_info = get_userdata($author);$rendu .= " &rarr; Articles de l'auteur ".$user_info->display_name."</li>";
global $author;$user_info = get_userdata($author);$rendu .= ' &rarr; '. __('Articles de l\'auteur', 'ffeeeedd') .' '.$user_info->display_name.'</li>';
}
elseif ( is_tag()){
$tag=single_tag_title("",FALSE);$rendu .= " &rarr; Articles sur le th&egrave;me <span>".$tag."</span>";
$tag=single_tag_title("",FALSE);$rendu .= ' &rarr; '. __('Articles sur le thème', 'ffeeeedd') .' <span>'.$tag.'</span>';
}
elseif ( is_date() ) {
if ( is_day() ) {
global $wp_locale;
$rendu .= '<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="inbl"><a href="'.get_month_link( get_query_var('year'), get_query_var('monthnum') ).'" itemprop="url">'.$wp_locale->get_month( get_query_var('monthnum') ).' '.get_query_var('year').'</a></li> ';
$rendu .= " &rarr; Archives pour ".get_the_date();
$rendu .= ' &rarr; '. __('Archives pour', 'ffeeeedd') .' '.get_the_date();
}
else if ( is_month() ) {
$rendu .= " &rarr; Archives pour ".single_month_title(' ',false);
$rendu .= ' &rarr; '. __('Archives pour', 'ffeeeedd') .' '.single_month_title(' ',false);
}
else if ( is_year() ) {
$rendu .= " &rarr; Archives pour ".get_query_var('year');
$rendu .= ' &rarr; '. __('Archives pour', 'ffeeeedd') .' '.get_query_var('year');
}
}
elseif ( is_archive() && !is_category()){
Expand All @@ -298,16 +227,16 @@ function ariane() {
$rendu .= ' &rarr; '.$var.'';
}
elseif ( is_search()) {
$rendu .= " &rarr; R&eacute;sultats de votre recherche <span>&rarr; ".get_search_query()."</span>";
$rendu .= ' &rarr; '. __('Résultats de votre recherche', 'ffeeeedd') .' <span>&rarr; '.get_search_query().'</span>';
}
elseif ( is_404()){
$rendu .= " &rarr; 404 : Page non trouv&eacute;e";
$rendu .= ' &rarr; 404 : '. __('Page non trouvée', 'ffeeeedd') .'';
}
elseif ( is_single()){
$category = get_the_category();
$category_id = get_cat_ID( $category[0]->cat_name );
if ($category_id != 0) {
$rendu .= " &rarr; ".myget_category_parents($category_id,TRUE,' &rarr; ')."<span>".the_title('','',FALSE)."</span>";
$rendu .= ' &rarr; '.myget_category_parents($category_id,TRUE,' &rarr; ').'<span>'.the_title('','',FALSE).'</span>';
}
elseif ($category_id == 0) {
$post_type = get_post_type();
Expand Down Expand Up @@ -399,7 +328,7 @@ function ffeeeedd_comment( $comment, $args, $depth ) {
echo get_avatar( $comment, 44 );
printf( '<cite itemprop="creator">%1$s %2$s</cite>',
get_comment_author_link(),
( $comment->user_id === $post->post_author ) ? '<small> ( Rédacteur ) </small>' : ''
( $comment->user_id === $post->post_author ) ? '<small> ('. __('Rédacteur', 'ffeeeedd') .') </small>' : ''
);
printf( '<time datetime="%2$s" itemprop="commentTime">%3$s</time>',
esc_url( get_comment_link( $comment->comment_ID ) ),
Expand All @@ -410,16 +339,16 @@ function ffeeeedd_comment( $comment, $args, $depth ) {
</header>

<?php if ( '0' == $comment->comment_approved ) : ?>
<p>Votre commentaire est en attente de modération.</p>
<p><?php echo __('Votre commentaire est en attente de modération', 'ffeeeedd'); ?>.</p>
<?php endif; ?>

<section itemprop="commentText">
<?php comment_text(); ?>
<?php edit_comment_link('Modifier', '<p>', '</p>' ); ?>
<?php edit_comment_link( __( 'Modifier', ''), '<p>', '</p>' ); ?>
</section>

<div class="reply" itemprop="replyToUrl">
<?php comment_reply_link( array_merge( $args, array( 'reply_text' => 'Répondre', 'after' => ' <span>&darr;</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
<?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Répondre', ''), 'after' => ' <span>&darr;</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
</div>
</article>
<?php
Expand Down Expand Up @@ -529,10 +458,10 @@ function meta_box_title_description() {
function parametres_seo_metabox_content($post) {
$val_title = get_post_meta($post->ID,'_parametres_seo_title',true);
$val_description = get_post_meta($post->ID,'_parametres_seo_description',true); ?>
<title>Ces champs sont utilisés dans les balises 'meta' utiles au référencement naturel et au partage social.</title>
<p><strong>Titre</strong></p>
<title><?php echo __('Ces champs sont utilisés dans les balises \'meta\' utiles au référencement naturel et au partage social', 'ffeeeedd'); ?>.</title>
<p><strong><?php echo __('Titre', 'ffeeeedd'); ?></strong></p>
<input id="parametres_seo_title" name="parametres_seo_title" type="text" style="width:100%;" value="<?php echo $val_title; ?>" />
<p><strong>Description</strong></p>
<p><strong><?php echo __('Description', 'ffeeeedd'); ?></strong></p>
<textarea id="parametres_seo_description" name="parametres_seo_description" style="width:100%; resize:none;"><?php echo $val_description; ?></textarea>
<?php }

Expand Down Expand Up @@ -646,9 +575,5 @@ function insert_image_meta_in_head() {
echo '<meta property="twitter:image" content="' . get_header_image() . '"/>';
echo '<!-- Fin des métas Image dynamiques -->';
}
<<<<<<< HEAD
add_action( 'wp_head', 'insert_image_meta_in_head' );
=======
}
add_action( 'wp_head', 'insert_image_meta_in_head' );
>>>>>>> Harmonisation indentation
Binary file added lang/en_EN.mo
Binary file not shown.
140 changes: 140 additions & 0 deletions lang/en_EN.po
@@ -0,0 +1,140 @@
msgid ""
msgstr ""
"Project-Id-Version: Ffeeeedd 1.0\n"
"POT-Creation-Date: 2013-04-10 19:43+0100\n"
"PO-Revision-Date: 2013-04-10 19:45+0100\n"
"Last-Translator: \n"
"Language-Team: Luc Poupard, Gaël Poupard\n"
"Language: English\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.5.5\n"
"X-Poedit-KeywordsList: __;_e;_c\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=n>2;\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-SearchPath-0: G:\\02_sites\\00_github\\ffeeeedd\n"

#: G:\02_sites\00_github\ffeeeedd/archive.php:41
#: G:\02_sites\00_github\ffeeeedd/archive.php:42
#: G:\02_sites\00_github\ffeeeedd/author.php:45
#: G:\02_sites\00_github\ffeeeedd/author.php:46
#: G:\02_sites\00_github\ffeeeedd/category.php:33
#: G:\02_sites\00_github\ffeeeedd/category.php:34
#: G:\02_sites\00_github\ffeeeedd/home.php:33
#: G:\02_sites\00_github\ffeeeedd/home.php:34
#: G:\02_sites\00_github\ffeeeedd/index.php:33
#: G:\02_sites\00_github\ffeeeedd/index.php:34
#: G:\02_sites\00_github\ffeeeedd/single.php:28
#: G:\02_sites\00_github\ffeeeedd/single.php:29
#: G:\02_sites\00_github\ffeeeedd/tag.php:33
#: G:\02_sites\00_github\ffeeeedd/tag.php:34
#: G:\02_sites\00_github\ffeeeedd/extensions/recherche/search.php:36
#: G:\02_sites\00_github\ffeeeedd/extensions/recherche/search.php:37
msgid ", "
msgstr ""

#: G:\02_sites\00_github\ffeeeedd/functions.php:74
msgid "Lire l'article «&nbsp;"
msgstr "Read the post «&nbsp;"

#: G:\02_sites\00_github\ffeeeedd/functions.php:182
#: G:\02_sites\00_github\ffeeeedd/functions.php:197
msgid "Voir tous les articles de"
msgstr "See all posts for"

#: G:\02_sites\00_github\ffeeeedd/functions.php:189
msgid "Actualité"
msgstr "News"

#: G:\02_sites\00_github\ffeeeedd/functions.php:201
msgid "Articles de l'auteur"
msgstr "Author's articles"

#: G:\02_sites\00_github\ffeeeedd/functions.php:204
msgid "Articles sur le thème"
msgstr "Posts about"

#: G:\02_sites\00_github\ffeeeedd/functions.php:210
#: G:\02_sites\00_github\ffeeeedd/functions.php:213
#: G:\02_sites\00_github\ffeeeedd/functions.php:216
msgid "Archives pour"
msgstr "Archives for"

#: G:\02_sites\00_github\ffeeeedd/functions.php:230
msgid "Résultats de votre recherche"
msgstr "Results of your search"

#: G:\02_sites\00_github\ffeeeedd/functions.php:233
msgid "Page non trouvée"
msgstr "Page not found"

#: G:\02_sites\00_github\ffeeeedd/functions.php:317
#: G:\02_sites\00_github\ffeeeedd/extensions/commentaires/functions.php:34
msgid "Pingback :"
msgstr "Pingback :"

#: G:\02_sites\00_github\ffeeeedd/functions.php:317
#: G:\02_sites\00_github\ffeeeedd/extensions/commentaires/functions.php:34
msgid "(Modifier)"
msgstr "(Edit)"

#: G:\02_sites\00_github\ffeeeedd/functions.php:331
msgid "Rédacteur"
msgstr "Author"

#: G:\02_sites\00_github\ffeeeedd/functions.php:342
msgid "Votre commentaire est en attente de modération"
msgstr "Your comment is awaiting for moderation"

#: G:\02_sites\00_github\ffeeeedd/functions.php:347
msgid "Modifier"
msgstr "Edit"

#: G:\02_sites\00_github\ffeeeedd/functions.php:351
msgid "Répondre"
msgstr "Reply"

#: G:\02_sites\00_github\ffeeeedd/functions.php:369
#: G:\02_sites\00_github\ffeeeedd/extensions/commentaires/functions.php:86
msgid "Name"
msgstr "Name"

#: G:\02_sites\00_github\ffeeeedd/functions.php:376
#: G:\02_sites\00_github\ffeeeedd/extensions/commentaires/functions.php:93
msgid "Email"
msgstr "Email"

#: G:\02_sites\00_github\ffeeeedd/functions.php:383
#: G:\02_sites\00_github\ffeeeedd/extensions/commentaires/functions.php:100
msgid "Website"
msgstr "Website"

#: G:\02_sites\00_github\ffeeeedd/functions.php:461
msgid ""
"Ces champs sont utilisés dans les balises 'meta' utiles au référencement "
"naturel et au partage social"
msgstr ""
"These field are used in 'meta' tag for search engine optimization and social "
"sharing"

#: G:\02_sites\00_github\ffeeeedd/functions.php:462
msgid "Titre"
msgstr "Title"

#: G:\02_sites\00_github\ffeeeedd/functions.php:464
msgid "Description"
msgstr "Description"

#: G:\02_sites\00_github\ffeeeedd/extensions/recherche/search.php:60
msgid "&larr; Précédent"
msgstr "&larr; Previous"

#: G:\02_sites\00_github\ffeeeedd/extensions/recherche/search.php:61
msgid "Suivant &rarr;"
msgstr "Next &rarr;"

#: G:\02_sites\00_github\ffeeeedd/extensions/recherche/searchform.php:14
msgid "Rechercher"
msgstr "Search"

0 comments on commit ecd5c6c

Please sign in to comment.