I am working on a bilingual site (english and dzongkha). This is the first time i am using drupal. My problem is that the contents i have posted in english comes out fine but the contents in dzongkha comes in a very small font size. Is there a way to increase the font size for dzongkha only?

Is it necessary to convert the dzongkha (dz) text into NCR unicode?

Any help on this would be appreciated.

Comments

prestonso’s picture

When working with this kind of issue, you can have one of two different options: you can either apply an id to the body tag to allow you to change all font sizes of Dzongkha, or you can create an alternate style sheet altogether to increase font sizes of only certain elements.

Increasing font sizes globally:

Add the following to your page.tpl.php:

<?php global $language; ?>
...
<body id="<?php print $language->language ?>">
...
</body>

What this will do is provide a language id that you can manipulate within the CSS like so:

body#en {
font-size: 1em;
}
body#dz {
font-size: 1.5em;
}

Depending on the set language of each page, the body will automatically adjust to the same language so that you can style entire pages exclusively for either language.

Increasing font size for certain elements:

Add the following to your page.tpl.php:

<head>
<?php global $language; ?>
...
<link href="<?php print base_path() . path_to_theme() ?>/<?php print $language->language ?>.css" rel="stylesheet" type="text/css" />
</head>
...

This PHP will print the language abbreviation in front of the .css extension, so that you'll have two CSS files to edit: "en.css" and "dz.css". You can go into each one and provide styles for each element, like this:

In the en.css:

ul {
font-size: 1em;
}

In the dz.css:

ul {
font-size: 1.5em;
}

___________________

Preston So
Web/Print Designer
Monarch Digital, Colorado Springs
My non-updated non-Drupal site

___________________

Preston So

sangu’s picture

Hi Prestonso, Firstly thanks for ur reply. I tried both the ways u suggested but could not get it rite.

1. When Increasing font sizes globally with this code:

<?php global $language; ?>
...
<body id="<?php print $language->language ?>">
...
</body>

And i check the page source, the body id is blank (it does not provide a language id)

<body id="">

2. I tried Increasing font size for certain elements, the en.css and dz.css are not printed. These files are suppose to be inside the theme folder that i am using, rite?

I am not doing something right, can u please suggest?

And inside the drupal installation there is a folder named 'drupal/files/css', i see that there many css there. How are these css updated?

prestonso’s picture

1. What's your version of Drupal?

2. You have to create the en.css and dz.css files and import styles from your original style sheet and change them depending on the language. So en.css will contain the English elements that will have a smaller font size, and dz.css will contain the Dzongkha elements that will have a larger font size. Place both style sheets into your theme folder.

In terms of "drupal/files/css", I'm not seeing the CSS files you're talking about. What's your version?
___________________

Preston So
Web/Print Designer
Monarch Digital, Colorado Springs
My non-updated non-Drupal site

___________________

Preston So

sangu’s picture

i am using drupal 5.7. i have created the dz.css & en.css but i think it is still using the default style.css. i looked inside the /drupal/include/, there is theme.inc where this is given:

drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
  $themes = list_themes();

  // Only select the user selected theme if it is available in the
  // list of enabled themes.
  $theme = $user->theme && $themes[$user->theme]->status ? $user->theme : variable_get('theme_default', 'garland');

  // Allow modules to override the present theme... only select custom theme
  // if it is available in the list of installed themes.
  $theme = $custom_theme && $themes[$custom_theme] ? $custom_theme : $theme;

  // Store the identifier for retrieving theme settings with.
  $theme_key = $theme;

  // If we're using a style, load its appropriate theme,
  // which is stored in the style's description field.
  // Also add the stylesheet using drupal_add_css().
  // Otherwise, load the theme.
  if (strpos($themes[$theme]->filename, '.css')) {
    // File is a style; loads its CSS.
    // Set theme to its template/theme
    drupal_add_css($themes[$theme]->filename, 'theme');
    $theme = basename(dirname($themes[$theme]->description));
  }
  else {
    // File is a template/theme
    // Load its CSS, if it exists
***   if (file_exists($stylesheet = dirname($themes[$theme]->filename) .'/style.css')) {  ***
      drupal_add_css($stylesheet, 'theme');
    }
  }

I don't know php so iam assuming, that the line marked with *** is still looking for the default style.css and using it. So how can i make en.css and dz.css to be used for specific language?

With the code for Increasing font size for certain elements given below inserted inside page.tpl.php:

<?php global $language ?>
<link href="<?php print base_path() . path_to_theme() ?>/<?php print $language->language ?>.css" rel="stylesheet" type="text/css" />

After which the page source is like this:

<head>
...
...
<link href="/drupal5/themes/greenNblack/.css" rel="stylesheet" type="text/css" />
</head>
...

the style sheet should have been dz.css or en.css but it just gives "/.css". Why is this happening?

Thanks

prestonso’s picture

What modules are you using for multilingual capabilities?
___________________

Preston So
Web/Print Designer
Monarch Digital, Colorado Springs
My non-updated non-Drupal site

___________________

Preston So

sangu’s picture

I am using multilanguage - i18n module for multilingual capability.

  • i18n - blocks
  • i18n - menu
  • i18n - profile
  • i18n - taxonomy
  • i18n - views
  • Internationalization
  • Translation
  • I am also using the multilanguage - i18n-experimental module.

  • i18n - content types
  • Strings
  • Synchronization
  • Translatable Text
  • The theme used is 'greenNblack'.

    sangu’s picture

    Hi,
    I finally got the language to use its repective css (en.css & dz.css) with this code:

    <head>
    <title>...</title>
    <link href="<?php print base_path() . path_to_theme() ?>/<?php print $language ?>.css" rel="stylesheet" type="text/css" />
    ...
    </head
    

    Thanks for ur help.

    bsimon’s picture

    In Drupal 6, I found that 'Increasing font sizes globally' worked great. I added the code after the first occurrence of the body tag in the page.tpl.php file. I didn't include the closing body tag

    But actually, it still seems to be working OK if I remove the global definition and only include the id="" at the end of the body class="" definition which is already in the tpl.php. So that line looks like this, and no other changes are made to the file

    <<body class="<?php print $body_classes; ?>" id="<?php print $language->language ?>">

    I'm still wondering how to apply language-specific css styles when two languages are mixed on the same page. This is apparently difficult in Drupal at the moment.