2

My drupal site is in default English language and I have added Spanish and German languages using Internationalization and Locale Modules. When I switch to other language using Language Switcher block placed in header of my site, It translated Drupal Interface like admin menu and other core displays, but does not translate nodes or module pages which I have added. I have used t() function to display page contents or titles and its not translating them using t function.

The code for the page which I have added is as:

function MY_MODULE_menu() {     
     $items['fee/per'] = array(
    'title callback' => 'attendance_og_get_title',
    'title arguments' => array('calendar'),
    'description' => t('Shows attendance percentage recorded per day for a group in a calendar.'),      
    'page callback' => 'attendance_og_calendar_page',
    'file' => 'fee_management.pages.inc'
  );    

    return $items;
}

function attendance_og_get_title($c) {
    return t('!entity_type Attendance Report (Aggregated)',  array('!entity_type' => ucfirst('Some Name ' . $c)));  
}

File fee_managemen.pages.inc.

 function attendance_og_calendar_page($entity_type, $etid) {
       return array(
        '#prefix' => '<div class="alert-message block-message info offsetfull2 bottomonly">' .
        t('This view shows the percentage attendance recorded per attendance day in this group. An attendance day is a calendar day in which attendance was taken.') . '</div>',
        '#markup' => '<div id="loading">' . t('Loading.. I am loading here') . '</div><div id="calendar"></div>',
      );
}

Please help me to get this working.

6

As your module is not hosted on drupal.org, the strings it uses are not available on localize.drupal.org, where they can be translated in any language available there.

As such, you need to enable the Locale module, and translate the strings on your site.

With Drupal 7, you visit the page at admin/config/regional/translate/translate, and you get a list of untranslated strings you can translate.

screenshot

In Drupal 6, a similar page is available on admin/build/translate/search.

screenshot

screenshot

2

Go to Language and Translation configuration , select the language and check all un translated strings , you will get all the text written in t("here"), then save the translations of each word and string . This is how it will work :) Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.