×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Another language in mod_comments

Another language in mod_comments 14 years 6 months ago #9652

  • Khoa Duong
  • Khoa Duong's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
When I display the module mod_comments on the front end page, it says (name of the person) said. How can I change the word said to f.ex. Norwegian language.

Regards

Khoa Duong

Another language in mod_comments 14 years 6 months ago #9653

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
another discussion about the module here: compojoom.com/forum/topic?id=9412&p=9647#p9647

The module also uses joomla 1.5 language model. The default language file is placed in languages/your-language/your-langauge.mod_comments.ini - translate the strings in the english file and put it in the right folder and everything will be fine.

P.S. Don't forget to share your language file with us :)

Another language in mod_comments 14 years 6 months ago #9657

  • Nils Ally
  • Nils Ally's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 299
  • Thank you received: 33
I have made the Norwegian language for this, and it is sent to you Daniel.

Sorry, didn't read this correctly, where you just used "Norwegian" as an example, and not as a "want".

Another language in mod_comments 14 years 6 months ago #9668

  • Khoa Duong
  • Khoa Duong's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
I made a file called nb-NO.mod_comments.ini and put it in language/nb-NO. Then I translated SAID = said into Norwegian. It worked perfect.

But how I can translate 2 days ago in the front end to Norwegian?

Another language in mod_comments 14 years 6 months ago #9669

  • Nils Ally
  • Nils Ally's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 299
  • Thank you received: 33
If your site is using the Norwegian language setup, or JoomFish, it should work automatically.
I can't get that to work on my site at all...

Another language in mod_comments 14 years 6 months ago #9678

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
ah, we developers are some times lazy bastards.
To translate those string you will have the following changes.
Go to components/com_comment/joscomment/utils.php and find those lines:
if ((int)$years) {
				$formatDate = sprintf('%d year' . ((int)$years == 1 ? '' : 's'). ' ago', $years);
			} elseif ((int)$months) {
				$formatDate = sprintf('%d month' . ((int)$months == 1 ? '' : 's'). ' ago', $months);
			} elseif ((int)$days) {
				$formatDate = sprintf('%d day' . ((int)$days == 1 ? '' : 's'). ' ago', $days);
			} elseif ((int)$hours) {
				$formatDate = sprintf('%d hour' . ((int)$hours == 1 ? '' : 's'). ' ago', $hours);
			} elseif ((int)$minutes) {
				$formatDate = sprintf('%d minute' . ((int)$minutes == 1 ? '' : 's'). ' ago', $minutes);
			} elseif ((int)$seconds) {
				$formatDate = sprintf('%d second' . ((int)$seconds == 1 ? '' : 's'). ' ago', $seconds);
			} else {
				$formatDate = sprintf('%d second' . ((int)$seconds == 1 ? '' : 's'). ' ago', $seconds);
			}
around line 600
and change them to this:
			if ((int)$years) {
				$formatDate = JText::sprintf('%d YEAR' . ((int)$years == 1 ? '' : 'S'). ' AGO', $years);
			} elseif ((int)$months) {
				$formatDate = JText::sprintf('%d MONTH' . ((int)$months == 1 ? '' : 'S'). ' AGO', $months);
			} elseif ((int)$days) {
				$formatDate = JText::sprintf('%d DAY' . ((int)$days == 1 ? '' : 'S'). ' AGO', $days);
			} elseif ((int)$hours) {
				$formatDate = JText::sprintf('%d HOUR' . ((int)$hours == 1 ? '' : 'S'). ' AGO', $hours);
			} elseif ((int)$minutes) {
				$formatDate = JText::sprintf('%d MINUTE' . ((int)$minutes == 1 ? '' : 'S'). ' AGO', $minutes);
			} elseif ((int)$seconds) {
				$formatDate = JText::sprintf('%d SECOND' . ((int)$seconds == 1 ? '' : 'S'). ' AGO', $seconds);
			} else {
				$formatDate = JText::sprintf('%d SECOND' . ((int)$seconds == 1 ? '' : 'S'). ' AGO', $seconds);
			}

After this open your language file
your language.com_comment.ini and add translation for this:
%D YEAR AGO = %d year ago
%D YEARS AGO = %d years ago
%D MONTH AGO = %d month ago
%D MONTHS AGO = %d months ago
%D WEEK AGO = %d week ago
%D WEEKS AGO = %d weeks ago
%D DAY AGO = %d day ago
%D DAYS AGO = %d days ago
%D HOUR AGO = %d hour ago
%D HOURS AGO = %d hours ago
%D SECOND AGO = %d second ago
%D SECONDS AGO = %d seconds ago

Another language in mod_comments 14 years 6 months ago #9719

  • Robin Molnar
  • Robin Molnar's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
Also, there are two lines missing:

%D MINUTE AGO=%d minute ago
%D MINUTES AGO=%d minutes ago

Thanks,
Robin

Another language in mod_comments 14 years 6 months ago #9720

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Oh yea, I found that minutes later, but I forgot to update the thread. thank you!
  • Page:
  • 1
Time to create page: 0.116 seconds