Author Topic: tpl localisation  (Read 9855 times)

0 Members and 1 Guest are viewing this topic.

Offline Foggy

  • Tireless poster
  • ****
  • Posts: 806
    • View Profile
Re: tpl localisation
« Reply #15 on: December 27, 2007, 12:36:17 AM »
basically, be able to load strings for [special:strings] from more then one file.

Edit: Just thought I'd try what I was asking and it worked but because you have to use {{load}} in [special:begin] at the top of the page the contents of the [special:string] sections that were loaded are displayed.

Edit2: Actually it didn't work, the special:strings were cached and a restart of hfs proved this. I'm trying to find the forum post which explains about loading them from external files. Found the post and using Load from special:begin isnt working for me as I said above.
A picture can explain better than i can. PICTURE
« Last Edit: December 27, 2007, 06:11:15 AM by Foggy »

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: tpl localisation
« Reply #16 on: December 30, 2007, 02:36:03 AM »
i may create a macro M (we'll decide the name later) that can handle string tables like these.

so you load any table
{{set|mytable|{{load|tablefile.txt}}/set}}

you can even append tables at later time
{{set|mytable|{{^mytable}} {{load|othertable.txt}}/set}}

and when you need a value from the table
{{M|mytable|key}}


opinions?

Offline Foggy

  • Tireless poster
  • ****
  • Posts: 806
    • View Profile
Re: tpl localisation
« Reply #17 on: December 30, 2007, 08:20:47 AM »
I like it, it will make it easier to use dynamic content becuase we would be able to load certain strings when a certain condition exists.

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: tpl localisation
« Reply #18 on: January 04, 2008, 08:41:27 PM »
available from next beta

Offline Mars

  • Operator
  • Tireless poster
  • *****
  • Posts: 1890
    • View Profile
Re: tpl localisation
« Reply #19 on: January 04, 2008, 10:15:51 PM »
Don't forget to add a macro with this possiblity

{{M|mytable| [sectionname] }}wich include all the section [sectionname]

this syntax  [...] is important to make difference with 'key'

{{M|mytable| [sectionname] }} or  {{M section|mytable|sectionname}}

 I know what rejetto will say to me :
"who needs this ?"

;D ;D ;D

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: tpl localisation
« Reply #20 on: January 05, 2008, 03:29:38 PM »
the M macro has been called "from table".
as you guess, "from table" has nothing to do with the feature you asking.
moreover, it is already available since build #161. it is {{section|name|file}} but i forgot to document it. :)
« Last Edit: January 05, 2008, 03:32:37 PM by rejetto »

Offline Foggy

  • Tireless poster
  • ****
  • Posts: 806
    • View Profile
Re: tpl localisation
« Reply #21 on: January 17, 2008, 01:47:12 PM »
is already available since build #161. it is {{section|name|file}} but i forgot to document it. :)

I just tried to use this and couldnt figure out how to. I ended up using set and from table instead.