mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-06-11 16:34:57 +03:00
feat(skd-compile): multilang presentation на conditionalAppearance item
При значении-словаре {ru, en, ...} эмитим <dcsset:presentation> как
LocalStringType с <v8:item>/<v8:lang>/<v8:content>; при строке —
по-прежнему xs:string. Раньше всегда жёстко xs:string, что давало
LOST для multilang.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# skd-compile v1.51 — Compile 1C DCS from JSON
|
||||
# skd-compile v1.52 — Compile 1C DCS from JSON
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[string]$DefinitionFile,
|
||||
@@ -2226,7 +2226,12 @@ function Emit-ConditionalAppearance {
|
||||
|
||||
# Presentation
|
||||
if ($ca.presentation) {
|
||||
X "$indent`t`t<dcsset:presentation xsi:type=`"xs:string`">$(Esc-Xml "$($ca.presentation)")</dcsset:presentation>"
|
||||
# Multilang dict {ru, en, ...} → LocalStringType; иначе — xs:string
|
||||
if ($ca.presentation -is [hashtable] -or $ca.presentation -is [System.Collections.IDictionary] -or $ca.presentation -is [PSCustomObject]) {
|
||||
Emit-MLText -tag "dcsset:presentation" -text $ca.presentation -indent "$indent`t`t"
|
||||
} else {
|
||||
X "$indent`t`t<dcsset:presentation xsi:type=`"xs:string`">$(Esc-Xml "$($ca.presentation)")</dcsset:presentation>"
|
||||
}
|
||||
}
|
||||
|
||||
if ($ca.viewMode) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# skd-compile v1.51 — Compile 1C DCS from JSON
|
||||
# skd-compile v1.52 — Compile 1C DCS from JSON
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
import argparse
|
||||
import json
|
||||
@@ -1863,7 +1863,11 @@ def emit_conditional_appearance(lines, items, indent, block_view_mode=None):
|
||||
|
||||
# Presentation
|
||||
if ca.get('presentation'):
|
||||
lines.append(f'{indent}\t\t<dcsset:presentation xsi:type="xs:string">{esc_xml(str(ca["presentation"]))}</dcsset:presentation>')
|
||||
# Multilang dict {ru, en, ...} → LocalStringType; иначе — xs:string
|
||||
if isinstance(ca['presentation'], dict):
|
||||
emit_mltext(lines, f'{indent}\t\t', 'dcsset:presentation', ca['presentation'])
|
||||
else:
|
||||
lines.append(f'{indent}\t\t<dcsset:presentation xsi:type="xs:string">{esc_xml(str(ca["presentation"]))}</dcsset:presentation>')
|
||||
|
||||
if ca.get('viewMode'):
|
||||
lines.append(f'{indent}\t\t<dcsset:viewMode>{esc_xml(str(ca["viewMode"]))}</dcsset:viewMode>')
|
||||
|
||||
Reference in New Issue
Block a user