Language is not changing in a component of Joomla - joomla

I am in the process of adding some lines of code to change the language automatically when the language is changed in the language selection module. One of my component in Joomla, it doesn't respect the language changing through language selection.
it's already the language.ini file is in the language directory is corresponding to this language. But the language is not changed. Is there any special joomla code to make it dynamic?

You should output text in Joomla like this:
echo JText::_("HELLO");
And you'll have to create an ini file with the language code and the name of the component/model. E.g.: en-GB.mod_modulename.ini. In this file you can define the translation for the string, like:
HELLO=Hola
When switching the language, the lines where JText is used, will display the correct language.

Related

Magento price format showing wrong after changing language

Price formatting shows wrong after changing the default language English to another language.
In my main website it outputs like Rs.1,200,000.00 but after changing the language from English to another language its outputs like Rs.1.200.000,00.
How can I fix that issue?
You can change the priceformat in this file:
lib/Zend/Locale/Data/[lang].xml
You can search for:
<numbers>
<symbols>
<decimal>.</decimal>
<group>,</group>
</symbols>
</numbers>
Edit
changed folder name local to locale

Using variables in custom joomla module for tooltips

I'm new to joomla development, but I can't seem to figure out how to dynamically fetch descriptions to be displayed as tool tips for the form data of a module backend. I'm looking at an example module from joomlart and their code for a single field element in their xml file looks like this.
<field
name="mainWidth"
type="text"
default="auto"
size="5"
label="MAIN_WIDTH"
description="MAIN_WIDTH_DESC" />
MAIN_WIDTH and MAIN_WIDTH_DESC are obviously variables that are somehow being accessed and rendered later when the module is run in the backend but I can't find where the values to these variables are stored or how to replicate this behavior. Any help would be appreciated.
Label is the label that prints to screen, and description is rendered as the tooltip.
You can just replace these variable names with the actual text and it will work when the form is rendered.
However, in your example, I believe they are using language files to get the text to display.
Whilst you can set a language file within your module for that module's use, naming convention suggests to me that these are being pulled from somewhere like the template's language file.
( Such a file is likely to be found either under /language or /administrator/language or /templates/yourtemplate/language )
The benefit of such files is to allow for translations of the site to exist without having to write a new module / template each time.
Ultimately, if you don't want various language versions of your site, and you only intend to use the module on one site and not sell it as an extension, then there is no strong need to create a language file for your own bespoke modules (though best practise would probably be to do so).

Is it possible to change text directly in the code

I would like to know if there is a way to change text in the code instead of using the admin panel? I have Filezilla installed and can access my site/files from there.
If I use the inspect element in any browser, I can see an HTML structure, but as I have understood there is no HTML document in Magento, right? So where do I go if I want to make a change to a text element on my site and I don't want to use the admin panel?
Most of the text elements are handled by Magento's language translation system.
Quite often, you don't have to mess around hacking templates, just simply add a line to the translation CSV with the text string exactly as it appears, add a comma and then the new text string you want Magento to display.
For example, if you're working with US English, you can use the following file in your own custom template package as follows:
app/design/frontend/default/your_package/locale/en_US/translate.csv
Let's for example, change one of the window shade bar titles in the One Page Shopping Cart. Add a line to translate.csv as follows:
"Billing Information","Billing Address Information"
How this works, in the template the following line normally displays the title:
<?php echo $this->__('Billing Address') ?>
This code snippet $this->__('Billing Address') is a call to Magento's language translation system. It reads the translate.csv file finds Billing Address and changes it to Billing Address Information when it assembles the page html.
Lotta people out there have made changing text like this far harder than it has to be.
Hunting down the proper template, changing the text, finding the template got messed up, or trying to remember after the fact what was changed.
VS.
Changing a simple central file that contains all the text string translations... Often only by adding a new line to the file
Magento actually makes this very simple.
Thank you! So magento stores all text in .csv? or just the stuff that needs to be translated? I'm making a search for .csv via Filezilla but I only get two languages (the site is translated to multiple languages). Should I be looking somewhere else?

Multi-language store- Changing custom menu's language dynamically

I am doing Multi-language store in magento. i have some custom menu in header section like how to order, Help etc. .
now currently these menu i have given direct link like
<li>Help</li>
<li>how to order</li>
i am not sure how multi-language feature will work with this menu.. How can i write these top menu as if It will change with language change.
any suggestions will be helpful for me.
thanks
Any text that is hard-coded into your template needs to be wrapped in the translation helper.
echo $this->__('Help');
But make sure the block it applies to has a helper declared, otherwise you'll need to load the generic helper.
Mage::helper('core')->__('Help')
Then, you can edit the relevant translation CSV file. By putting "Help" in the first column, and the translation in the second column.
Although, you'll be able to use translate in-line once you are using the above PHP.

Magento Language File for Admin-Customer Account Page

Maybe I'm just tired...but I can't seem to locate the language file relevant to the backend Customers>Manage Customers>Individual Record
I just want to change the form label "Suffix" to "Credentials".
Can you use inline translation to do it?

Resources