
+2 votes
in Plugins by
Chat room plugin is a great plugin! Thank you (:-)! However, as I understand there are no translate files. I have been trying to find the places where I could translate by myself some words that are presented to the final user such as "Private Messages", "Inbox", "sent items"?

By the way, I am trying to translate it to Brazilian portuguese where there is already an available translation!

Is there a way to do that?
Q2A version: 1.7.0
As I understood it seems that this plugin is using the original lang file. Can someone point me a plugin that does the same, but allows the functionality of lang-translation? The ones that I know either include extra lang-default files or we can change it in the admin panel!

2 Answers

+3 votes
selected by
Best answer

Well, most likely this line says it all: https://github.com/svivian/q2a-chat-room/blob/ce5dbc1c630169ec7ef65e38feb59d338aceac4a/qa-chat.php#L20

Most likely there is a mix between language strings from the core and some custom ones from that plugin itself. E.G., lines 27, 28, 29, 88, 95, 113 and so on. You'll find to spot them one by one. They are spread between files qa-chat.php and qa-chat.js. No other way to translate this.

Regarding your request for a plugin that includes language files, you can take a look at this one: https://github.com/pupi1985/q2a-maximum-tag-length

Yes I never got around to adding language files to the chat room plugin. I'll update it when I can.
0 votes

when you want to translate a dot js file that haven't a function qa_lang() , you must convert all the messages in js variables and set them with the QA function related to content ( $qa-content ) :

writing this in php

            $qa_content['script_var']['js_hello'] = qa_lang('myplugin/js_hello') ;

will produce in header this js line script , assuming the translation is provided in the appropriate lang file :


var js_hello = 'Bonjour la compagnie' ;


Then, you can safely replace  'Bonjour la compagnie' in the js file by js_hello and be sure that your translation in any language will be well handled.

See qa-ajax.js of the dbsave plugin ( or qa-chat2.js of the chat hack which implements the chat translation )