Is it possible to override files contained in admin/includes/languages/english/images/buttons in admin/includes/languages/english/extra_definitions/images/buttons or place files for new buttons there so as not modify the admin core file(s)?
Is it possible to override files contained in admin/includes/languages/english/images/buttons in admin/includes/languages/english/extra_definitions/images/buttons or place files for new buttons there so as not modify the admin core file(s)?
Not in the /extra_definitions sub-directory, but you could add differently-named buttons to admin/includes/languages/english/images/buttons and then override the base language-file definitions via a lang.mysite_buttons.php file in admin/includes/languages/english/extra_definitions.
Expanding my question a bit...I'm late to the 1.5.8a party and hopelessly confused about where to place array-based language defines so that no admin core files are modified for the following three cases:
(1) existing core defines I want to override for a specific page and an existing core admin/includes/languages/english/lang.PAGE.php file exists, and
(2) existing core defines I want to override for a specific page and an existing core admin/includes/languages/english/lang.PAGE.php file does not exist, and
(3) non-existing (custom) defines for one or more admin pages
Also, I gather the substring matching capability on the store side does not exist in admin. Is that correct?
The admin-language overrides, as mentioned in a couple of other threads, are cumbersome.
0. To override language definitions in the main language file, e.g. admin/includes/languages/lang.english.php, you can simply copy that file (renamed so you 'remember') to admin/includes/languages/extra_definitions and make your changes there. I'll recommend including only those definitions you're overriding.
1. The cumbersome bit: There isn't a page-specific language-file override mechanism. The best I can offer is a admin/includes/languages/english/extra_definitions/lang.something.php that checks the $current_page (which needs to be a global since called from a class) and switch based on the page to do your page-specific overrides.
2. This condition doesn't exist in the base Zen Cart distribution.
3. For non-core admin pages, you can simply use admin/includes.languages/english/{lang.}new_page.php. For additional constants on in-core admin pages, see #1, above.
Thank you!
This not in the docs?
Steve
github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...
lat9...
I tried the admin/includes/languages/english/extra_definitions/lang.something.php approach with switch on $current_page. Got the following fatal error.
The error occurs when loading the admin login screen. Any suggestions (other than give up)?[29-Mar-2024 13:24:30 America/New_York] PHP Fatal error: Uncaught TypeError: array_merge(): Argument #2 must be of type array, int given in /domain/includes/classes/ResourceLoaders/ArraysLanguageLoader.php:67
Stack trace:
#0 /domain/includes/classes/ResourceLoaders/ArraysLanguageLoader.php(67): array_merge(Array, 1)
#1 /domain/includes/classes/ResourceLoaders/ArraysLanguageLoader.php(47): Zencart\LanguageLoader\ArraysLanguageLoader->processArrayFileList('includes/langua...', Array)
#2 /domain/includes/classes/ResourceLoaders/AdminArraysLanguageLoader.php(31): Zencart\LanguageLoader\ArraysLanguageLoader->loadArraysFromDirectory('includes/langua...', 'english', '/extra_definiti...')
#3 /domain/includes/classes/ResourceLoaders/AdminArraysLanguageLoader.php(18): Zencart\LanguageLoader\AdminArraysLanguageLoader->loadLanguageExtraDefinitions()
#4 /domain/includes/classes/ResourceLoaders/LanguageLoader.php(28): Zencart\LanguageLoader\AdminArraysLanguageLoader->loadInitialLanguageDefines(Object(Zencart\LanguageLoader\LanguageLoader))
#5 /domain/admin/includes/init_includes/init_languages.php(48): Zencart\LanguageLoader\LanguageLoader->loadInitialLanguageDefines()
#6 /domain/includes/autoload_func.php(40): require_once('/domain...')
#7 /domain/admin/includes/application_top.php(42): require('/domain...')
#8 /domain/admin/login.php(8): require('/domain...')
#9 /domain/admin/index.php(11): require('domain...')
#10 {main}
thrown in /domain/includes/classes/ResourceLoaders/ArraysLanguageLoader.php on line 67
I have separate $define = [....]; return $define; code between each $current_page case and break statement plus a default case and break.
torvista...Not that I could find for overriding admin language constants and file locations for same.
> This not in the docs?
It's really not supported. There are sneaky tricks you can use but they might not work in all cases.
Just update the admin language files in place and do a diff when you upgrade.
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Ok, I give up. Too bad, maybe in a future version.
Bookmarks