بنقرة واحدة
add-category
// Add a new search category (OSM type with translations, synonyms, and emoji) to data/categories.txt. Use when asked to add, create, or insert a search category, search synonym, or map feature type.
// Add a new search category (OSM type with translations, synonyms, and emoji) to data/categories.txt. Use when asked to add, create, or insert a search category, search synonym, or map feature type.
| name | add-category |
| description | Add a new search category (OSM type with translations, synonyms, and emoji) to data/categories.txt. Use when asked to add, create, or insert a search category, search synonym, or map feature type. |
Ask the user for:
shop-leather, amenity-cafe. Multiple types separated by |@group to attach (e.g. @shop, @category_eat). Grep ^@ in data/categories.txt for existing groupsU+XXXX Unicode format, placed as synonyms on the en: lineConvert OSM type dashes to dots: shop-leather → [type.shop.leather].
Check if the entry exists in data/strings/types_strings.txt.
python3 tools/python/translate.py --context "context here" "English Name"
This outputs translations in both categories.txt and strings.txt formats via DeepL+Google[type.osm.type] entry to data/strings/types_strings.txt:
[type.shop.leather]
comment = context used for translation
en = Leather Shop
ar = متجر السلع الجلدية
...sorted alphabetically by language code...
zh-Hant = 皮具店
The first synonym for each language MUST exactly match the translation in types_strings.txt. This is a hard requirement.
Append popular search synonyms after | — only terms users would actually type in the search box. Keep it minimal.
A digit 1-9 before a synonym controls the minimum characters needed for the suggestion to appear:
3Cafe → user must type 3+ charsFor ru, uk, be: short nouns (under 6 letters) need both nominative and genitive forms:
ru:Вино|вина
For sr: threshold is 8 letters. Longer nouns rely on error correction.
osm-type1|osm-type2|@group1|@group2
en:4Type Name|synonym|U+1F6B0
ar:Arabic Name
be:Belarusian Name
...languages sorted alphabetically by code...
zh-Hant:Traditional Chinese
en: line always first after the headerOnly if adding a category shown in the app's search screen. Requires three coordinated file changes:
data/categories.txt# First keyword should match [category_name] definition in strings.txt!
@category_name
en:Display Name|synonym
...translations...
data/strings/strings.txt[category_name]
comment = Search category for ...; any changes should be duplicated in categories.txt @category_name!
tags = android-app,android-libs-car,apple-maps
en = Display Name
...translations for all supported locales...
The en = value must match the first keyword on the en: line (without prefix digit).
libs/search/displayed_categories.cppAdd "category_name" to the m_keys initializer list.
Sort languages:
python3 tools/python/sort_categories.py --in-place
Build and run tests:
cmake --build build-agent --target search_tests && ctest -j --test-dir build-agent --stop-on-failure --output-on-failure -R search_tests
If a displayed category was added, also run:
cmake --build build-agent --target indexer_tests editor_tests && ctest -j --test-dir build-agent --stop-on-failure --output-on-failure -R "indexer_tests|editor_tests"