WordPress.org

Ready to get started?Download WordPress

Forums

Translatable "Edit This" in index.php (4 posts)

  1. Anonymous
    Unregistered
    Posted 10 years ago #

    I tried to translate the "Edit This" link that sticks in the meta info of all posts at my wordpress installation.
    It became much easier after the change below. The only difference is that I give __('Edit This') as the argument for the edit_post_link function, Edit This is already the default argument so nothing is changed. I considered changing the function edit_post_link instead, but I found no good way to make it translatable then translated twice which is even worse. The full diff for my index.php:
    diff -u -r1.73 index.php
    --- index.php 28 Apr 2004 07:26:49 -0000 1.73
    +++ index.php 5 Jun 2004 19:44:43 -0000
    @@ -37,7 +37,7 @@
    <div class="post">
    <h3 class="storytitle" id="post-<?php the_ID(); ?>">" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></h3>
    - <div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?> — <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(); ?></div>
    + <div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?> — <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>
    <div class="storycontent">
    <?php the_content(); ?>

  2. Anonymous
    Unregistered
    Posted 10 years ago #

    diff -u -r1.73 index.php
    --- index.php 28 Apr 2004 07:26:49 -0000 1.73
    +++ index.php 5 Jun 2004 19:44:43 -0000
    @@ -37,7 +37,7 @@
    <div class="post">
    <h3 class="storytitle" id="post-<?php the_ID(); ?>">" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></h3>
    - <div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?> — <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(); ?></div>
    + <div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?> — <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>
    <div class="storycontent">
    <?php the_content(); ?>

    Did not read instructions properly ;-)

  3. Ryan Boren
    WordPress Dev
    Posted 10 years ago #

    Done.

  4. Anonymous
    Unregistered
    Posted 10 years ago #

    The best way to translate is to use the template and leave everything else in english. More information is available in the wordpress wiki topic about localization.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.