Different Translations for Requests And Listings Forms

Hello.
I want to translate the forms for’ requests’ and ‘listings’ separately. However they seem to be the same form.
eg when I translate the ‘Add Details’ on listings form as ‘Add Vehicle Details’
then the same translation is used in the request form. Which makes no sense there. (I would want it translated here as ‘Add Trip Details’ .
How can I achieve this?

Hi,

Please try these PHP snippets (How to add custom code snippets - HivePress Help Center):

For listings:

add_filter(
	'hivepress/v1/routes',
	function( $routes ) {
		if(isset($routes['listing_submit_details_page'])){
			$routes['listing_submit_details_page']['title'] = 'Add listing details';
		}

		return $routes;
	},
	1000
);

For request:

add_filter(
	'hivepress/v1/routes',
	function( $routes ) {
		if(isset($routes['request_submit_details_page'])){
			$routes['request_submit_details_page']['title'] = 'Add listing details';
		}

		return $routes;
	},
	1000
);

​I hope this is helpful to you.

Yes this is helpful.
However I need also translate the ‘title’ and ‘Images’ parts also for the 2 different forms.
This is very important for my site

eg My ‘title’ on Listings form should be ‘Number Plate’ on requests should be ‘images’
My ‘images’ on Listings form should be ‘Car Images’ on requests form should be ’ images’
Kindly assist.

Hi,

Please try these PHP snippets:

Change title for listing:

add_filter(
	'hivepress/v1/forms/listing_update',
	function($form){
		
		if(isset($form['fields']['title'])){
			$form['fields']['title']['label'] = 'Custom text';	
		}
		
		return $form;
	},
	1000
);

Change title for request:


add_filter(
	'hivepress/v1/forms/request_update',
	function($form){
		
		if(isset($form['fields']['title'])){
			$form['fields']['title']['label'] = 'Custom text';	
		}
		
		return $form;
	},
	1000
);

Change images for listing:

add_filter(
	'hivepress/v1/forms/listing_update',
	function($form){
		
		if(isset($form['fields']['images'])){
			$form['fields']['images']['label'] = 'Custom text';	
		}
		
		return $form;
	},
	1000
);

Change images for request:

add_filter(
	'hivepress/v1/forms/request_update',
	function($form){
		
		if(isset($form['fields']['images'])){
			$form['fields']['images']['label'] = 'Custom text';	
		}
		
		return $form;
	},
	1000
);

​I hope this is helpful to you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.