Welcome, Guest. Please Login or Register.
May 09, 2025, 05:45:58 PM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  A new lang file mod « previous next »
Pages: [1] 2 Reply Ignore Print
Author Topic: A new lang file mod  (Read 1152 times)
groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
A new lang file mod
« on: December 13, 2002, 10:33:21 PM »
Reply with quote

I have been working on this mod that seperates the language files dependent upon what script you are using.

Right now I am a bit confused. I have to use this code before any function uses any text, yet it still must get the proper language.$chkusrlng = $modSettings['userLanguage'];
$chklngfile = $chklngfile2 = $settings[23];

   if ($chkusrlng == 1)
   {
      if ($chklngfile == Null)
      {
         include_once ("$sourcedir/$language");
      }
      else
      {
         include_once ("$sourcedir/$chklngfile2");
      }
   }
   else
   {
      include_once ("$sourcedir/$language");
   }

I also want it to be versatile so that I can use this mod on boards that have some modifications.
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
Gobalopper
Mod Team
YaBB God
*****
Posts: 993


Cookie Monster

WWW
Re:A new lang file mod
« Reply #1 on: December 14, 2002, 11:25:35 PM »
Reply with quote

So what is the question you have then? :)
Logged
groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Re:A new lang file mod
« Reply #2 on: December 15, 2002, 04:24:26 AM »
Reply with quote

Where do I put it
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
Jack.R.Abbit
Mod Team
YaBB God
*****
Posts: 553


RACE FOR SPENT!

Re:A new lang file mod
« Reply #3 on: December 15, 2002, 07:26:15 AM »
Reply with quote

now I am confused.  That looks a lot like the code that is in the index.php right after the call to LoadUserSettings();.  What does yours do that the other does not?  And why can't you put it there int he index.php?  Did I mention that I was confused?  :)

-Jack
Logged

<--------  Mods by Jack  -------->
Package Server: http://www.modsbydesign.com/mods.by.jack/yabbse/ (now serving)


|----------------------------------------------|
|                                              |
|          DON'T PM ME FOR SUPPORT!             |
|                                              |
|----------------------------------------------|
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.

WWW
Re:A new lang file mod
« Reply #4 on: December 15, 2002, 07:54:48 AM »
Reply with quote

Alright maybe I could help explain this since I built the first part of the mod.

The part I built reads the directory "Sources" and makes a folder called "Languages/language_name" and then puts a file for each language in the folder. For instance:
"Languages/english/BoardIndex.php" then it opens the language file and selects all the language parts that are used for the BoardIndex and pastes them into the language file. This way the language file is split up and uses less resources and only loads what is needed. I have already finished my part of the mod, the language file is already seperated into multiple files.

Groundup is building the part that loads and uses what is in the language files. The problem is he doesn't know what, when, and where to load the language parts at.

And yes the code he printed in this topic is from index.php, he needs to replace this code with the new language code.

Anyway I hope this helps you understand groundup's problem.
« Last Edit: December 15, 2002, 07:56:14 AM by Chris Cromer » Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
Gobalopper
Mod Team
YaBB God
*****
Posts: 993


Cookie Monster

WWW
Re:A new lang file mod
« Reply #5 on: December 15, 2002, 09:40:50 AM »
Reply with quote

Hah, no I'm still partially confused. :)

I can see the idea behind what you are doing and why you would want to...

If you already have the language files built wouldn't it just be a simple case of parsing what is passed in the url and then loading the language file? This could be done in each php file I suppose. Or maybe in the fastfind section where you would already know what php file you are loading. Just make a call to some function before you include the file.
Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.

WWW
Re:A new lang file mod
« Reply #6 on: December 15, 2002, 02:05:15 PM »
Reply with quote

One of the major problems was what to do about global language parts such as the stuff used in the template(Hey, username, you have x message, x are new.) Plus there are some problems with the source files loading other source files, for instance, the Poll.php includes Post.php to use some of it's function which require texts from both of those files.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Re:A new lang file mod
« Reply #7 on: December 15, 2002, 05:11:01 PM »
Reply with quote

I think Chris said it best ;)
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
Gobalopper
Mod Team
YaBB God
*****
Posts: 993


Cookie Monster

WWW
Re:A new lang file mod
« Reply #8 on: December 16, 2002, 12:02:07 AM »
Reply with quote

Well you would probably have to make a "basic" language file that is used on pages before any includes are done.

As for pages including other pages you could either include all the text for the pages it will include in the language file for that page or just include the text files on a per page basis at the very beginning of each php file.

Instead of splitting up the language file why not use single quotes instead of double, try to minimize the numbers of strings there are overall, maybe take out the admin strings to another file and include it only if you are the admin user, or other easier approaches. It seems to me splitting it all up is going to be a lot of work...
« Last Edit: December 16, 2002, 12:16:54 AM by Gobalopper » Logged
David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:A new lang file mod
« Reply #9 on: December 16, 2002, 12:51:05 AM »
Reply with quote

Already done the single quote thing.
Logged

groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Re:A new lang file mod
« Reply #10 on: December 16, 2002, 02:22:08 AM »
Reply with quote

we made a script to split it up. that works. now to make the mod. considering that a language file is like 50kb and a page might only use 5kb (if that), you are saving on a lot of memory and overall, making the script faster.
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Re:A new lang file mod
« Reply #11 on: December 16, 2002, 02:23:20 AM »
Reply with quote

there is one way to do this, by searching for every function and after the global stuff, adding in a call to the including of the language file. This is not only annoying but wont work when you have other mods installed and wont work when you upgrade (like to 1.5.0)
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
Gobalopper
Mod Team
YaBB God
*****
Posts: 993


Cookie Monster

WWW
Re:A new lang file mod
« Reply #12 on: December 16, 2002, 03:30:15 AM »
Reply with quote

Have you done any tests to see how much time you are saving? From the splitting the files up part, not the other things.

It makes sense to take out the admin text as there is a lot of it and its rarely used. But splitting everything else up seems to be a lot of work for what probably isn't much time improvement. But prove me wrong. :)
« Last Edit: December 16, 2002, 03:33:14 AM by Gobalopper » Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.

WWW
Re:A new lang file mod
« Reply #13 on: December 16, 2002, 04:33:37 AM »
Reply with quote

It isn't alot of work, I made a script that splits the language file up instantly for you.

The most that needs to be done now is just loading the langauge files when needed.
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
groundup
Disciple of Joe, Head Cleric
Mod Team
YaBB God
*****
Posts: 2983


Error 309: Please notify the administrator of this

WWW
Re:A new lang file mod
« Reply #14 on: December 23, 2002, 09:59:24 PM »
Reply with quote

too bad I can't get this working, I could stop all of those memory issues and it would also prove to be a boost in speed and lessen load :-\
Logged

http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
http://www.fastfinancialfreedom.org - financial freedom is a myth
fastfinancialfreedom.org
Pages: [1] 2 Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  A new lang file mod « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.052 seconds with 20 queries.