Topic: Bold font on document is reset when using tranlation language

when i use translation language, font on the document no longer Bold, how to fix this?

example, in invoice on English language the title Item Code, Item Description, Quantity Unit, Price, Discount %, Total, TOTAL INVOICE and amount in words is Bold, but when i use translation language Indonesia installed from the extension, it is no longer bold.

Re: Bold font on document is reset when using tranlation language

open lang/installed_languages.inc find your language array then replace 'encoding' => 'utf-8' with 'encoding' => 'iso-8859-1'
In case of Indonesian it will be like this:

array (
    'name' => 'Indonesian',
    'package' => 'id_ID',
    'code' => 'id_ID',
    'encoding' => 'iso-8859-1',
    'version' => '2.4.1-3',
    'path' => 'lang/id_ID',
  ),

Phuong

Re: Bold font on document is reset when using tranlation language

notrinos wrote:

open lang/installed_languages.inc find your language array then replace 'encoding' => 'utf-8' with 'encoding' => 'iso-8859-1'

Hi Notrinos,

before i update the encoding, the settings were already in indonesian, after i change the encoding and login to the system language become English eventhough the language in the display settings is Indonesia, i refert back the encoding but still the language stays in English, the language in display settings have no effect even if i change it back and forth from English to indonesia it will stay in English,  i must remove the indonesia and reinstall then it go back to normal but still the Bold text did not show.

Re: Bold font on document is reset when using tranlation language

Please add your language manually:

- Go to Setup/Install Update Languages and check if English (US) already installed then remove it
- Manually create an empty folder lang/en_US/LC_MESSAGES
- Press button Add new language manually then enter the following parameters:

Language Code: en_US
Language Name: Indo
Encoding: iso-8859-1
Right To Left: No
Default Language: No

The two file PO, MO please choose the coresponding file in the lang/id_ID/LC_MESSAGES
Click Update then you can go to Preferences then select new added language (Indo)

Phuong

Re: Bold font on document is reset when using tranlation language

Hi Notrinos,

so after i add it manually the language still in English, then i change the default language to Indonesia (not indo) then the document is translated correctly with Bold text, login page also translated correctly, but the main menu and sub menu is still in english.

Re: Bold font on document is reset when using tranlation language

You may need to restart Apache

Phuong

7 (edited by sikumbang 09/06/2019 09:21:37 am)

Re: Bold font on document is reset when using tranlation language

Hi Notrinos,

After restart apache service document go back to english, now only the login page that translated.
So i repeat it from the start, delete the code section of en_US in the installed_language.inc, delete the folder en_US, then repeat from the start, but before changing the language to Indo i restart the apache service, result is the same as before, document translated correctly with Bold text, login page also translated correctly but the main menu and sub menu still in English.

8 (edited by rafat 09/06/2019 10:55:53 am)

Re: Bold font on document is reset when using tranlation language

Hi sikumbang,

I also struggled a lot with Languages.. especially RTL. So its helpful to  list your lang/installed_languages.inc (all contents).
The location and version  of your po and mo files and the OS (Windows, Linux etc..).

9 (edited by notrinos 09/06/2019 12:51:18 pm)

Re: Bold font on document is reset when using tranlation language

Another approach you can do a little modification in the core so that dont need to install language manually, it will works with Indonesian but Im not sure with other languages.
Download all dejavusans and dejavusansb font files here then paste into reporting/fonts folder
https://github.com/overblog/tcpdf/tree/master/fonts
Replace line 160 of reporting/includes/class.pdf.inc with this code:

default :          $fontname = "dejavusans";         break;

Now Indonesian language can be used with it's default encoding utf-8

Phuong

Re: Bold font on document is reset when using tranlation language

Hi Rafat,
so here is content of my installed_language.inc

installed_language wrote:

<?php

/* How to make new entries here for non-packaged languages:

-- 'code' should match the name of the directory for the language under \lang
.-- 'name' is the name that will be displayed in the language selection list (in Users and Display Setup)
-- 'rtl' only needs to be set for right-to-left languages like Arabic and Hebrew
-- 'encoding' used in translation file
-- 'version' always set to '' for manually installed languages.
-- 'path' installation path related to FA root (e.g. 'lang/en_US').
*/


$installed_languages = array (
  0 =>
  array (
    'code' => 'C',
    'name' => 'English',
    'encoding' => 'iso-8859-1',
  ),
  1 =>
  array (
    'code' => 'en_US',
    'name' => 'Indo',
    'path' => 'lang/en_US',
    'encoding' => 'iso-8859-1',
    'rtl' => false,
    'package' => '',
    'version' => '',
  ),
  2 =>
  array (
    'name' => 'Indonesian',
    'package' => 'id_ID',
    'code' => 'id_ID',
    'encoding' => 'utf-8',
    'version' => '2.4.1-3',
    'path' => 'lang/id_ID',
  ),
);

$dflt_lang = 'id_ID';

location of .po and.mo files is in each language folder
/var/www/html/FA/lang/id_ID/LC_MESSAGES
/var/www/html/FA/lang/en_US/LC_MESSAGES
Linux version ubuntu 18.04 LTS

Hi Notrinos,
Try to put the dejavusans (.php, .z, .ctg.z) and dejavusanb (.php, .z, .ctg.z) files on reporting/fonts then choose Indonesia as the language when opening the invoice it returns TCPDF error: Could not include font definition file: dejavusans.php
try tp change the line 160 of class.pdf.inc with dejavusansb it return the same error,
if i set to Indo it works, translated correctly with bold text, but the menu and sub menu still in english.

Re: Bold font on document is reset when using tranlation language

Try font files attached here, this is the files that I'm using on my system with the same setting without bold issue
https://www.dropbox.com/s/s2tj56yo2qrlb … s.zip?dl=0

Phuong

Re: Bold font on document is reset when using tranlation language

@sikumbang - the translation is  always giving some problems. Especially the utf-8 supported languages. 

There are possible fixes.
1. Your Linux system must be updated with locale.
2. Apache should be enabled with gettext
3. Some fa translations are mismatched with strings in fa. Especially I  can tell one thing. From login page the password was not fetched the string properly with po file.

4. There are bugs in translation file as well.  Truncate it by removing duplicate entries unnecessary commented lines.

Re: Bold font on document is reset when using tranlation language

notrinos wrote:

Try font files attached here, this is the files that I'm using on my system with the same setting without bold issue
https://www.dropbox.com/s/s2tj56yo2qrlb … s.zip?dl=0

Notrinos... you are the man! it works!
thanks a lot, really really apreciate it.

Hi kvvaradha,
my problem is now fixed with that font file from notrinos, thanks for the heads up.

Re: Bold font on document is reset when using tranlation language

@joe
should default utf-8 font be dejavusans instead of dejavu ? We have no dejavu bold font pack so that reports can show the bold characters

Phuong

Re: Bold font on document is reset when using tranlation language

Yes, maybe we should use @notrinos solution for the default utf-8 font.

Joe