This forum is for questions about translating the Drupal user interface. See also the Translations group.

Form Autocomplete example

<?php
/**
* Impelements hook_permission()
*/
function example_permission() {
return array(
'example' => array(
'title' => t('example'),
'description' => t('example text.'),
),
);
}

/**
* Implements hook_menu().
*
* */
function example_menu(){
$items['example/autocomplete'] = array(
'title' => '',
'page callback' => 'drupal_get_form',
'page arguments' => array('example_autocomplete'),
'access arguments' => array('example'),
'type' => MENU_CALLBACK,
);
$items['pincode/autocomplete'] = array(
'page callback' => 'pincode_autocomplete',
'access arguments' => array('example'),
'type' => MENU_CALLBACK
);
return $items;
}
/**
* Implements auto complete call back.
*
* */
function pincode_autocomplete($string){
$matches = array();
$query = db_select("web_pincode","wcm");
$query->fields('wcm',array('pin_code'));
$query->condition('wcm.pin_code', db_like($string) . '%', 'LIKE');
$query->range(0,15);
$res = $query->execute();
while ($res1 = $res->fetchAssoc()) {
$matches[$res1['pin_code']] = check_plain($res1['pin_code']);
}
drupal_json_output($matches);
}
/**
* Implements auto complete form().
*
* */
function example_autocomplete($form, &$form_state){

Language switch

Hi all. Can somebody tell me how to switch language after clicking on the custom picture. I believe that all what it is is adding ?language=pl on the end of web address......but how to do it so I will still stay on the same page.

Thanks for all help.

translate site_name and also change default front page in Arabic

I have a bilingual (Arabic/English) site and need to change
1) the site name, and
2) the default node that is on the Arabic homepage. The node itself has been translated and views fine at its full url, but on the homepage, when the language is switched to Arabic, it doesn't go to the Arabic version.

Approving translations as an admin

Hello,

I am one of the admin of the Hindi Translation project. I wanted to know how do admins approve translations of other members? Please help me out here.

Thanks

I am not sure if a similar topic was posted before I tried searching but didn't find anything so I apologize if this question is frequently asked, I haven't seen it anywhere.

showing different field depends on the language

Can i showing different field depends on the language ?

Same content in two languages

I have a type of content that users can add with different fields.
The fields are all numeric except one body of text.
I want that users can add their own content in a text field in 2 languages ​​or using 2 different fields, and it displays the content entered by the user in the selected language of the site.

Pages

Subscribe with RSS Subscribe to RSS - Translations