Post by thbr02 » Sun Mar 09, 2025 2:55 am

I try to make a OCMOD modification which adds the same code to all admin language files. Iv'e tried the code below, but it doesn't work. What am I doing wrong?

Code: Select all

	<file path="admin/language/sv-se/{*,*/*}/*.php">
		<operation error="log">
			<search trim="true"><![CDATA[
				// Text
			]]></search>
			<add position="before" trim="true"><![CDATA[
				//My addition start
				
				//My addition end
			]]></add>
		</operation>
	</file>

Active Member

Posts

Joined
Wed Jun 22, 2011 10:30 pm
Location - Sweden

Post by OSWorX » Sun Mar 09, 2025 5:03 pm

You can't be sure that all files will have the marker

Code: Select all

// Text
Better search for

Code: Select all

<?php

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by thbr02 » Sun Mar 09, 2025 6:03 pm

Thank you. I'll try this change. Does the path look okay to you?

Code: Select all

<file path="admin/language/sv-se/{*,*/*}/*.php">
]

Active Member

Posts

Joined
Wed Jun 22, 2011 10:30 pm
Location - Sweden

Post by OSWorX » Mon Mar 10, 2025 5:46 pm

thbr02 wrote:
Sun Mar 09, 2025 6:03 pm
Thank you. I'll try this change. Does the path look okay to you?

Code: Select all

<file path="admin/language/sv-se/{*,*/*}/*.php">
]
Looks good, see by yourself: https://github.com/opencart/opencart/wi ... ion-System

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: No registered users and 25 guests