diff --git a/UX-Guide-Metadata/bin/extract-ids-from-principles.xsl b/UX-Guide-Metadata/bin/extract-ids-from-principles.xsl new file mode 100644 index 00000000..8ced236c --- /dev/null +++ b/UX-Guide-Metadata/bin/extract-ids-from-principles.xsl @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/UX-Guide-Metadata/bin/extract-ids-from-techniques.xsl b/UX-Guide-Metadata/bin/extract-ids-from-techniques.xsl index eb9e0f15..8fd57a4b 100644 --- a/UX-Guide-Metadata/bin/extract-ids-from-techniques.xsl +++ b/UX-Guide-Metadata/bin/extract-ids-from-techniques.xsl @@ -12,7 +12,7 @@ - + diff --git a/UX-Guide-Metadata/bin/strings-crosscheck.sh b/UX-Guide-Metadata/bin/strings-crosscheck.sh index 49114ebe..74982703 100755 --- a/UX-Guide-Metadata/bin/strings-crosscheck.sh +++ b/UX-Guide-Metadata/bin/strings-crosscheck.sh @@ -23,38 +23,44 @@ basedir=$(dirname "$basedir") tmpdir=$(mktemp -d) # input files +principles="$basedir/../draft/principles/index.html" +xslt_principles="$basedir/extract-ids-from-principles.xsl" epub_techniques="$basedir/../draft/techniques/epub-metadata/index.html" onix_techniques="$basedir/../draft/techniques/onix-metadata/index.html" -xslt="$basedir/extract-ids-from-techniques.xsl" -canonical_json="$basedir/../draft/localizations/en-US/display_guide_vocabulary_w3c_en-US.json" +xslt_techniques="$basedir/extract-ids-from-techniques.xsl" +#canonical_json="$basedir/../draft/localizations/en-US/display_guide_vocabulary_w3c_en-US.json" output_dir="$basedir/../draft/localizations" # performs XSLT transformation on XHTML files -xsltproc "$xslt" "$epub_techniques" > "$output_dir/epub-metadata-strings.xml" -xsltproc "$xslt" "$onix_techniques" > "$output_dir/onix-metadata-strings.xml" +xsltproc "$xslt_principles" "$principles" > "$output_dir/principles-strings.xml" +xsltproc "$xslt_techniques" "$epub_techniques" > "$output_dir/epub-metadata-strings.xml" +xsltproc "$xslt_techniques" "$onix_techniques" > "$output_dir/onix-metadata-strings.xml" # converts XML files to CSV +java -jar "$basedir/libs/xml2csv-1.1.jar" "$output_dir/principles-strings.xml" > "$output_dir/principles-strings.csv" java -jar "$basedir/libs/xml2csv-1.1.jar" "$output_dir/epub-metadata-strings.xml" > "$output_dir/epub-metadata-strings.csv" java -jar "$basedir/libs/xml2csv-1.1.jar" "$output_dir/onix-metadata-strings.xml" > "$output_dir/onix-metadata-strings.csv" # converts JSON file to CSV -json_in_csv=$(jq -r ' - to_entries[] | - select(.value | type == "object" and (has("descriptive") or has("compact"))) | - [.key, .value.descriptive // "", .value.compact // ""] | - @csv -' "$canonical_json") -echo '"key","descriptive","compact"' > "$output_dir/canonical-json-strings.csv" -echo "$json_in_csv" >> "$output_dir/canonical-json-strings.csv" +# json_in_csv=$(jq -r ' +# to_entries[] | +# select(.value | type == "object" and (has("descriptive") or has("compact"))) | +# [.key, .value.descriptive // "", .value.compact // ""] | +# @csv +# ' "$canonical_json") +# echo '"key","descriptive","compact"' > "$output_dir/canonical-json-strings.csv" +# echo "$json_in_csv" >> "$output_dir/canonical-json-strings.csv" # converts CSV files to Excel +ssconvert "$output_dir/principles-strings.csv" "$output_dir/principles-strings.xlsx" ssconvert "$output_dir/epub-metadata-strings.csv" "$output_dir/epub-metadata-strings.xlsx" ssconvert "$output_dir/onix-metadata-strings.csv" "$output_dir/onix-metadata-strings.xlsx" -ssconvert "$output_dir/canonical-json-strings.csv" "$output_dir/canonical-json-strings.xlsx" +# ssconvert "$output_dir/canonical-json-strings.csv" "$output_dir/canonical-json-strings.xlsx" # cleanup +rm -f "$output_dir/principles-strings.csv" rm -f "$output_dir/epub-metadata-strings.csv" rm -f "$output_dir/onix-metadata-strings.csv" -rm -f "$output_dir/canonical-json-strings.csv" +# rm -f "$output_dir/canonical-json-strings.csv" echo "Operations completed. Need to manually update Excel file localizations/crosscheck strings epub-onix-canonical_json.xlsx" \ No newline at end of file diff --git a/UX-Guide-Metadata/draft/localizations/crosscheck strings epub-onix-canonical_json.xlsx b/UX-Guide-Metadata/draft/localizations/crosscheck strings epub-onix-canonical_json.xlsx index 5cd7c8e8..1a99eb90 100644 Binary files a/UX-Guide-Metadata/draft/localizations/crosscheck strings epub-onix-canonical_json.xlsx and b/UX-Guide-Metadata/draft/localizations/crosscheck strings epub-onix-canonical_json.xlsx differ diff --git a/UX-Guide-Metadata/draft/principles/index.html b/UX-Guide-Metadata/draft/principles/index.html index 6a3e41da..1bdb617c 100644 --- a/UX-Guide-Metadata/draft/principles/index.html +++ b/UX-Guide-Metadata/draft/principles/index.html @@ -259,7 +259,7 @@
This key information should always be displayed, even if there is no metadata (See the examples where @@ -288,22 +288,22 @@
This key information should always be displayed, even if there is no metadata (See the examples where @@ -352,22 +352,22 @@
This key information should always be displayed, even if there is no metadata (See the examples where @@ -473,30 +473,30 @@