Language Directory

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
User avatar
RonP
Veteran Member
Posts:319
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Language Directory

Post by RonP » 2026-08-19 13:59

Hi,
Is this a right asumption:
After every generation of a project the language directory is (re) build.

If this is true then I like to have a way to skip that proces (by the Hooks directory??)
I have made some minor translation changes but lately I found out that the where overridden.
And... Why would you have so many language subdirectories while you just need one (well. for me NL language) so can I delete the not wanted Language subdiretories?
If so... How do I do that.

User avatar
RonP
Veteran Member
Posts:319
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: Language Directory

Post by RonP » 2026-08-30 07:24

Hi,
Someone to answer?
Ron

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts:1464
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Language Directory

Post by onoehring » 2026-09-01 08:02

Hi Ron,

let me suggest a workaround.
For my projects I have created logos, additional scripts, scripts that I use, others, I use but I do not want the customer to have them.
For this purpose I have created a .cmd file which simply copies the files/folders, maybe overwriting files that AG has produced. The file is also capable to delete stuff from within the AG generated application directory.

The file looks somehow like this:

Code: Select all

@echo off
robocopy "c:\ag_development\project_a\web\special_from_root" "c:\ag_development\project_a\web" /E /COPY:DAT /DCOPY:DA /R:3 /W:5 /NP
del /Q "c:\ag_development\project_a\web\images"
rd "c:\ag_development\project_a\web\images"
The special_from_root directory is a directory that may contain other directories. Thus, all things in the special_from_root are put into the root of my application - essentially replacing files there if they exist.
Currently it looks like this:

Code: Select all

templates\
admin\
_intern\
resources\
plugins\
thumbnail.php
favicon.png
favicon.ico
language.php
logo.png
The del command removes stuff. So for you this means, you could delete all language files you do not want to ship etc.

Maybe this helps?

Olaf

User avatar
RonP
Veteran Member
Posts:319
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: Language Directory

Post by RonP » 2026-09-04 14:20

Olaf,
Thank you for sharing your workaround.
Wouldn't it be easier, for us a application developers, to have a "frozen" language file.?
So not an override by every application generation?
Ron

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts:1464
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Language Directory

Post by onoehring » 2026-09-05 09:02

Hi Ron,

you can always write protect the language file.
However, I once had the problem (using my method) that things changed and I actually copied old code which broke the application.
So either way - write protecting or copying you will need to check.

I have another suggestion: You could simply place your language file somewhere (in /hooks for example) and do a simple include in /hooks/header-extras.php . This way, your language file should overwrite the variables that have been included by AG already before.

Either way has it's advantages. I am not sure, if "frozen files" like you suggest are a good idea.

Olaf

User avatar
RonP
Veteran Member
Posts:319
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: Language Directory

Post by RonP » 2026-09-05 15:30

OIaf,
Thank you,
I'll take your suggestion:
your include in /hooks/header-extras.php
Ron

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts:1464
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Language Directory

Post by onoehring » 2026-09-06 07:48

Hi Ron,

just thought - if header-extras.php does not work, try to include it in the footer-extras.php

Olaf

User avatar
RonP
Veteran Member
Posts:319
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: Language Directory

Post by RonP » 2026-09-06 13:15

Olaf,
It works, I've place de PHP-code in file:

Code: Select all

header-extras.php
It didn't work in footer-extras.php
But... It should be nice if you only get Language files you really need (in my case: NL(dutch) and maybe an English on depending of the chosen language settings)

Thank you so much.
Ron

Post Reply