Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
English British support
« on October 11th, 2011, 03:30 PM »
I was wondering about this, since I figure it was inevitably going to come up (if nothing else, I'll probably end up wanting to do it)

Now, I figure there's a way that we can do that and make life quite easy to support the English British set without too much extra work.

loadLanguage already loads English standard anyway, as a fallback, so the required strings should always be declared. But if you're doing that, you can be very cheeky and just have English British quite literally be *only the changed strings*. If there's no difference between English and English British for a given string, why define it again?

There is one caveat: right now, the load-fallback is actually a setting, though there's no UI for it, because I figure you almost never would change it (and if you did want to change it, it's not like you couldn't just tweak the code manually... if you're at the stage where it would make a difference, you're going to be up to making code changes)

Curious to know what the thoughts are on this, both technically and generally.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: English British support
« Reply #1, on October 11th, 2011, 03:54 PM »
I'd tend to say it's more amusing/exciting to only keep the relevant entries.

The load fallback is here to stay, if you ask me. I think most people really prefer to have an English string rather than nothing.

Possibilities to explore...

- add a version number to every single language file. Increase version number whenever a change is made to the English version. Compare current version against English version to determine whether we need to load the English fallback (and warn the admin that their language file is broken.)

- store language files in a serialized array in the database. (or in the cache. I think there's already a cache level for language files. A bad one IIRC, because of the variables involved.) When caching fallback & non-fallback, check whether the English version has some extra strings, and only store those.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: English British support
« Reply #2, on October 11th, 2011, 04:01 PM »
Quote
I'd tend to say it's more amusing/exciting to only keep the relevant entries.
That's exactly it. English/British is the most insane language pack to exist because 98% of it is the same as the main English set.
Quote
The load fallback is here to stay, if you ask me.
I can't see it disappearing either, in which case we might as well remove the internal disable option for it.
Quote
add a version number to every single language file
That's not a bad idea. A little bit tricky to get right, but certainly doable.
Quote
store language files in a serialized array in the database.
The variable nature before made it practically impossible to get this one right, and the old language cache was incredibly unreliable, mostly because of Modifications.*.php and the fact that files weren't re-pulled through the cache after modification, so if a mod edited a language file, it never recached it until it naturally fell out the cache.

The real question is whether the benefit outweighs the hassle. I'm not sure what benefit it does actually have to do it for all strings, especially with the way different files reuse strings the way they do.

That said, what we *can* do is put edited strings in the DB, so instead of users having to make files editable through permissions, they just get to put it into the DB.

Dismal Shadow

  • Madman in a Box
  • Me: Who is Arantor? Cleverbot: It stands for time and relative dimensions in space.
  • Posts: 1,185
“I will stand on my ground as an atheist until your god shows up...If my irreligious bothers you much, and if you think everything I do is heresy to your god I don't care. Heresy is for those who believe, I don't. So, it isn't heresy at all!


   Jack in, Wedge,
   EXECUTE!

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: English British support
« Reply #4, on October 11th, 2011, 04:24 PM »
Quote from ~DS~ on October 11th, 2011, 04:20 PM
That's amazing.
That's amasing?
Nope, just amazing.
Quote
Color.
Colour?
Colour is the correct spelling, of course :P As is centre, serialise, initialise, humour, flavour etc.
Posted: October 11th, 2011, 04:21 PM

Also, I'm sure I mentioned I'd like to do a pirate language pack, which would similarly be based on English :whistle:

spoogs

  • Posts: 417
Re: English British support
« Reply #5, on October 11th, 2011, 04:24 PM »
Will never forget making my school lose the spelling bee when I was in the 7th grade because they couldn't spell colour and favourite properly. An apology years later didn't help much either.
Stick a fork in it SMF

Dismal Shadow

  • Madman in a Box
  • Me: Who is Arantor? Cleverbot: It stands for time and relative dimensions in space.
  • Posts: 1,185
Re: English British support
« Reply #6, on October 11th, 2011, 04:27 PM »
Quote from Arantor on October 11th, 2011, 04:24 PM
Quote from ~DS~ on October 11th, 2011, 04:20 PM
That's amazing.
That's amasing?
Nope, just amazing.
Quote
Color.
Colour?
Colour is the correct spelling, of course :P As is centre, serialise, initialise, humour, flavour etc.
Posted: October 11th, 2011, 04:21 PM

Also, I'm sure I mentioned I'd like to do a pirate language pack, which would similarly be based on English :whistle:
Do it, DO IT. It would be fun t' imitatin' pirate.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: English British support
« Reply #7, on October 11th, 2011, 04:30 PM »
Oh, adding a pirate language pack is something I started to do back in the RC3 days. I just didn't finish it because I was frustrated at the things I'm fixing now.

That, and there was a small problem with dealing with locales, but that's not a problem I have to worry about these days (knowing much more than I did about setlocale 18 months ago)

Norodo

  • Oh you Baidu, so randumb. (60 sites being indexed at once? Jeez)
  • Posts: 469
Re: English British support
« Reply #8, on October 11th, 2011, 06:45 PM »
Weh. Who needs the american way of spelling it anyway? British English and French should be standard!

MultiformeIngegno

  • Posts: 1,337
Re: English British support
« Reply #9, on October 11th, 2011, 10:31 PM »
Yeah, British English should be the only one (no American English at all)!

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: English British support
« Reply #10, on October 11th, 2011, 10:58 PM »
I'd have to go through and fix a number of strings in the core, and if I did that I'd want to use colour bbc instead of color and so on :/

There is another thing I'd do with this overhaul, actually. There's something that's annoyed me for a long time: the way languages are displayed to users for choosing.

If you have a list of languages, and you list them as English, French, Spanish... you're Anglicising it. It should be the proper language, e.g. English, Francais, Espanol. (Accents included, I just couldn't be bothered typing them)

Now, the reason it's done how it is right now is simply ease of programming and performance: it's easy enough to look up index.*.php files and split the * on _ and upper-case the first letters. That's how you end up with Spanish (or worse, Spanish Es, a construction that's somewhere between meaningless, irritating and unintuitive)

Instead, if you build and store a list, you can actually load the files themselves to get the right string, so you can actually have the files themselves contain a proper language-dependent string holding the proper form of that language's name in that language... can't say more logical than that IMO.

(It would replace the current getLanguages() process, and would cache the value inside $modSettings. I have no problem with only setting it from the admin panel and have the admin panel be the one to set it, so it's only set if the user asks to recache it, or when you add a new language.)

Dismal Shadow

  • Madman in a Box
  • Me: Who is Arantor? Cleverbot: It stands for time and relative dimensions in space.
  • Posts: 1,185

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278

Dismal Shadow

  • Madman in a Box
  • Me: Who is Arantor? Cleverbot: It stands for time and relative dimensions in space.
  • Posts: 1,185
Re: English British support
« Reply #13, on October 12th, 2011, 07:49 PM »
Yoda is a not a language per se but a translation.

"No one wants to die. Even people who want to go to heaven don’t want to die to get there. And yet death is the destination we all share. No one has ever escaped it. And that is as it should be, because Death is very likely the single best invention of Life. It is Life’s change agent. It clears out the old to make way for the new. Right now the new is you, but someday not too long from now, you will gradually become the old and be cleared away. Sorry to be so dramatic, but it is quite true."

Yoda:
"To die no one wants.  Even people who want to go to heaven want not to die to get there. And the destination we all share, yet death is.  Ever escaped it, no one has. And as it should be, that is, because very likely the single best invention of life, death is.  Life's change agent, is it.  To make way for the new it clears out the old.  You, right now the new is, but too long from now someday not, gradually become the old and be cleared away, you will.  To be so dramatic sorry, but quite true, it is.  Yes, hmmm."

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: English British support
« Reply #14, on October 12th, 2011, 08:09 PM »
I know :P From my POV, anything that requires altering a lot of language strings is effectively a language pack candidate.