mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-24 21:51:02 +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:
co-authored by
Claude Opus 4.7
parent
013d3c3a01
commit
2b8cdc40ca
@@ -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
|
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||||
param(
|
param(
|
||||||
[string]$DefinitionFile,
|
[string]$DefinitionFile,
|
||||||
@@ -2226,7 +2226,12 @@ function Emit-ConditionalAppearance {
|
|||||||
|
|
||||||
# Presentation
|
# Presentation
|
||||||
if ($ca.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) {
|
if ($ca.viewMode) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/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
|
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
@@ -1863,7 +1863,11 @@ def emit_conditional_appearance(lines, items, indent, block_view_mode=None):
|
|||||||
|
|
||||||
# Presentation
|
# Presentation
|
||||||
if ca.get('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'):
|
if ca.get('viewMode'):
|
||||||
lines.append(f'{indent}\t\t<dcsset:viewMode>{esc_xml(str(ca["viewMode"]))}</dcsset:viewMode>')
|
lines.append(f'{indent}\t\t<dcsset:viewMode>{esc_xml(str(ca["viewMode"]))}</dcsset:viewMode>')
|
||||||
|
|||||||
Reference in New Issue
Block a user