Forum categories

Обзор и введение в плагин Usercategories

Плагин «User Categories» в составе сборки Multistore позволяет организовать пользователей в виде структуры, которая отражает структуру онлайн-каталога товаров в модуле Mstore.

webitproff
webitproff • 2026-02-09 19:32 #440

#439 losdriver: 
привет, вот уже больше недели как пользуюсь плагином (скачивал у вас с гитхаба) и не могу разобраться как делать перевод названий категорий. сейчас на сайте всего два языка: русский и английский, а еще хочу китайский, но я что-то в ступоре с переводом. подскажите по категориям, как делать или это плагин какой-то нужен ?

 

добрый день. 

для решения вопроса перевода категорий (специализаций пользователей) на стороне и в области администрирования сайта, таких инструментов пока нет конкретно под этот плагин.

но, вопрос решить можно довольно просто, переводы нужных строк записываем в файлы локализации своего плагина (бекап делать обязательно всегда перед правками!)

открываем файл plugins/usercategories/lang/usercategories.ru.lang.php и добавляем строки

// usercategories.ru.lang.php
// usercategories structure localization заголовок и описание, язык - русский
if (isset($structure['usercategories']['site-administration']) && is_array($structure['usercategories']['site-administration'])) {
   $structure['usercategories']['site-administration']['title'] = 'Администрирование сайтов';
    $structure['usercategories']['site-administration']['desc'] = 'Управление, обслуживание и поддержка веб-сайтов на разовой, периодической или постоянной основе';
}
if (isset($structure['usercategories']['websites']) && is_array($structure['usercategories']['websites'])) {
   $structure['usercategories']['websites']['title'] = 'Веб-сайты';
    $structure['usercategories']['websites']['desc'] = 'Создание и разработка интернет-проектов, Сайты «под ключ», перенос сайтов, Веб-программирование, HTML-верстка, Интернет-магазины';
}

 

во второй файл, - plugins/usercategories/lang/usercategories.en.lang.php

// usercategories.en.lang.php
// usercategories structure localization - titles and descriptions, English version
первая категория
if (isset($structure['usercategories']['site-administration']) && is_array($structure['usercategories']['site-administration'])) {
   $structure['usercategories']['site-administration']['title'] = 'Website Administration & Support';
   $structure['usercategories']['site-administration']['desc'] = 'Full management, ongoing maintenance, technical support, and administration of websites — one-time tasks, regular updates, or continuous care';
}
вторая категория
if (isset($structure['usercategories']['websites']) && is_array($structure['usercategories']['websites'])) {
   $structure['usercategories']['websites']['title'] = 'Websites & Web Development';
   $structure['usercategories']['websites']['desc'] = 'Custom website creation, turnkey web projects, website migration, web development, HTML/CSS coding, e-commerce solutions, online stores';
}

 

И внимательно (новичкам), здесь ['site-administration'] и ['websites'] - это коды категорий вашей структуры плагина usercategories  - заменить своими значениями, и соответственно уже значения заголовков и описания

 

 

🗿

🧙‍♂️ Well met, good traveler! Fate has guided your steps to our humble realm. Here, wise sages and masters of the coding craft ⚒️📜 gather to unravel the mysteries of the code ✨⚙️, share their knowledge, and add new chapters to our chronicles.
⬅️ To the left lie ancient scrolls 📚 filled with forgotten wisdom. ⬆️ Straight ahead, friendly folk offer counsel 💬 to those in need. ➡️ To the right, you may become a chronicler ✍️ yourself, sharing your craft and leaving words of wisdom for those yet to come.
📝 Delay no longer—tell us the name by which you are known, complete the rite of registration 🛡️, and join our fellowship!
🏰 Our brotherhood holds no secret initiation, yet many halls remain closed to wandering guests, for some knowledge 💎 is reserved for those who choose to walk this path beside us.