03. Change and translate text - ihofmann/open-websoccer GitHub Wiki
This is how you change any text that is visible on the front site or in the AdminCenter.
The software is separated in modules and each module has its own messages declarations. This enables the installation of new features without overriding existing messages. Additionally, multiple languages are supported, which is why every module can have multiple messages file. There are three different types of messages files. For the language English ("en"), these are:
- adminmessages_en.xml: Messages which are displayed only in the AdminCenter.
- entitymessages_en.xml: Labels of database tabl names and columns.
- messages_en.xml: Messages which will appear at the front-end (website) only.
Example: You want to change the introduction sentence which is displayed to unregistered users:
Become the manager of a virtual football club, lead your team against other users and win the championship!
This sentence is in English, it appears on the frontend and is no database column label, therefore it must be a file called messages_en.xml.
The best idea is to use a tool for finding contents in files. For instance, use the search function of the program that you use anyway for opening text files, such as:
- Notepad++: Click on "Search" => "Search in files".
- Eclipse: If you imported the software as project, you can use "Search" => "File..";. Use "File name pattern" = "*.xml".
- Our you simply use the file search tool of your operating system.
In our case, the sentence above can be found at: websoccer/modules/frontend/messages_en.xml
If you have found the right file, you can simply edit the text which is between the square brackets, like:
<message id="home_teaser">Become the manager of a virtual football club, lead your team against other users and win the championship!</message>
Edit the text and execute following steps:
- Save the file.
- Upload the file to your server, using the same module sub folder (Example above: websoccer/modules/frontend/). Override the existing file.
- Log on to the AdminCenter.
- Click on "Empty Cache".
Important: Do not forget to click on "Empty Cache" after every text change. Otherwise the text change will not be active.