Post by CedSha » Sun Mar 02, 2025 6:13 am

From my previous post where I was searching for localisation of a particular string I was wondering if there was any tools in OC to help find missing strings in the text files. I come with making myself a simple one line command tool that despite it's simplicity is already quite helpful.

Code: Select all

find -type f -exec grep -l "\$this->load->language('extension/opencart/module/topic');" {} \; | while read file; do echo "Searching in file: $file"; grep -n "\$this->language->get" "$file"; done
One could replace
extension/opencart/module/topic
by any translation files of OC
As a test in the topic file I found these :

Code: Select all

Searching in file: /var/www/oc/extension/opencart/catalog/controller/module/topic.php
46:				'name'     => $this->language->get('text_all') . ($this->config->get('config_article_count') ? ' (' . $this->model_cms_article->getTotalArticles() . ')' : ''),
Searching in file: /var/www/oc/extension/opencart/admin/controller/module/topic.php
17:		$this->document->setTitle($this->language->get('heading_title'));
22:			'text' => $this->language->get('text_home'),
27:			'text' => $this->language->get('text_extension'),
32:			'text' => $this->language->get('heading_title'),
59:			$json['error']['warning'] = $this->language->get('error_permission');
67:			$json['success'] = $this->language->get('text_success');
Most of these strings are missing in my version of Opencart (4.1.0.0) topic file...
.

Image


User avatar
Newbie

Posts

Joined
Mon Sep 18, 2023 1:01 am

Who is online

Users browsing this forum: No registered users and 0 guests