meeting-room-booking-system / mrbs-code

MRBS application code
Other
121 stars 59 forks source link

bug in language file: string not picked #2830

Open jberanek opened 4 years ago

jberanek commented 4 years ago

Installed 1.9.0 today as an upgrade. Ran the checklang.php to get latest text strings in my lang file no.php

The text string $vocab["times_along_top"] was not picked, so I added it manually. Even if I translated the string, it was not shown in the GUI. Probably an error somewhere?

Pål Monstad

Reported by: *anonymous

Original Ticket: mrbs/support-requests/2137

jberanek commented 4 years ago

It's used in edit_area.php.

Original comment by: campbell-m

jberanek commented 4 years ago

Yes, but what is the reason why it is not possible to put the string in my language file? No affect. Hard coded in edit_area.php?

Pål

Original comment by: *anonymous

jberanek commented 4 years ago

What do you mean by "was not picked"? I can see it as

Missing times_along_top Times along the top

Original comment by: campbell-m

jberanek commented 4 years ago

It should work. The code in edit_area.php that uses it is

  $field->setLabel(get_vocab('times_along_top'))

Original comment by: campbell-m

jberanek commented 4 years ago

I mean it is not picked from my language file even if it exists there.

Original comment by: *anonymous

jberanek commented 4 years ago

What happens if you add this to config file: $override_locale = "no_NO.UTF-8";

and then add $vocab["times_along_top"] ="Vis tider horisontalt" to the no.lang file Will it work?

Pål

Original comment by: *anonymous

jberanek commented 4 years ago

Yes, it works for me.

Original comment by: campbell-m

jberanek commented 4 years ago

By the way, now you only need to write

$override_locale = "no_NO";

Original comment by: campbell-m

jberanek commented 4 years ago

I have now committed this transalation to the default branch in 63957f.

Original comment by: campbell-m

jberanek commented 4 years ago

I cannot get this one to work. I added the required string to lang.no. If a alter another string in the file the changes are made visable. Have i missed something?

Original comment by: *anonymous

jberanek commented 4 years ago

Can you post your lang.no file here?

Original comment by: campbell-m

jberanek commented 4 years ago

Here it is.

Original comment by: *anonymous

Attachments: https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/6e00cf701c/8b0a/attachment/lang%20%281%29.no

jberanek commented 4 years ago

Ah! You have it defined twice: once in Norwegian at line 400 and then it is overwritten in English at line 407.

Original comment by: campbell-m

jberanek commented 4 years ago

Oh, so the order in the file matters? I got it to work my moving the line further down the file. Thanks!

Original comment by: *anonymous

jberanek commented 4 years ago

What you really need to do is to delete the English one.

Original comment by: campbell-m

jberanek commented 4 years ago

okey, I'll try to remember that next time. Thanks!

Pål Monstad

Original comment by: *anonymous