Documentation for HxDCurrentVersion.json

Help on how to use HxD.
Post Reply
Maël
Site Admin
Posts: 1455
Joined: 12 Mar 2005 14:15

Documentation for HxDCurrentVersion.json

Post by Maël »

At the time of this writing the HxDCurrentVersion.json file looks like this:

Code: Select all

{
	"Product": "HxD",
	"Edition": "installable",
	"Development-Stage": "stable",
	"Version": "2.4.0.0",
	"Release-Date": "2020-02-28T00:00:00.0Z",
	"OSs": [
		"Windows XP",
		"Windows 2003",
		"Windows Vista",
		"Windows 7",
		"Windows 8",
		"Windows 10"
	],
	"Langs": [
		"de",
		"en"
	],
	"Unique-File-IDs": {
		"SHA-1": "6cb75b65c52178b77b65d6a690a5cff27bcab8f2",
		"SHA-512": "33714bf909de383b2df6c7b860634cad0f1c0f6954753076c417feddc1477f506bc887b1b867a9ca2945fe90e6fd0ca70bbf74a63999a818e394d60cff59df99"
	},
	"Download-URI": "https://mh-nexus.de/downloads/HxDSetup.zip"
}
The general file format, the type of each entry, and the possible values are outlined below:
  • Product: program name, can be: "HxD", "Property Edit", "ClearEdit", or any other name of a program I published/will publish
  • Edition: "installable", "portable", "installandportable"
  • Development-Stage: "RC", "alpha", "beta", "stable"
  • Version: n.n.n.n (where n is a positive integer >= 0), specifies the described program's version number (all mentions below of "this program version" refer to this)
  • Release-Date: release date and time of this program version; has UTC timezone and is in ISO8601 format
  • OSs: list of operating systems supported by this program version, possible values:
    • Windows 95
    • Windows 98
    • Windows ME
    • Windows NT4
    • Windows 2000
    • Windows XP
    • Windows 2003
    • Windows Vista
    • Windows 7
    • Windows 8
    • Windows 10
    • Windows 11
  • Langs: list of natural language translations available for this program version, follows rules of LOCALE_SABBREVLANGNAME. May be abbreviated to just two letters, in which case it follows the rules of "two-letter language abbreviation from ISO Standard 639".
  • Unique-File-IDs: the SHA-1 and SHA-512 hash of the file in Download-URI given as hexadecimal string
  • Download-URI: the URL of the download file/package for this program version
Maël
Site Admin
Posts: 1455
Joined: 12 Mar 2005 14:15

Re: Documentation for HxDCurrentVersion.json

Post by Maël »

The new format is slightly different:
  • Langs now uses language names, derived from "locale names"/LOCALE_SNAME (also called "Language Culture Name", "CultureInfo.Name", or "language tag" (on MSDN or BCP 47 language tag (Wikipedia)), such as de-DE, or en-US, instead of LOCALE_SABBREVLANGNAME/CultureInfo.ThreeLetterWindowsLanguageName, such as DEU, or ENU.
    Language names:
    Generally follow the pattern <language>-<REGION>, never include a sort order or custom part. Possible variations are <language>-<Script>-<REGION> or simply <language>.

    For details on the sub tags, i.e., parts in <>, see locale names below (separated into an extra post, since all the details I collected were distracting from the JSON format).
    Example (for HxD 2.5.0.0):

    Code: Select all

        "Langs": [
            "zh-CN",
            "de-DE",
            "el-GR",
            "en-US",
            "es-ES",
            "fr-FR",
            "hu-HU",
            "it-IT",
            "ja-JP",
            "ko-KR",
            "nl-NL",
            "pl-PL",
            "pt-BR",
            "ru-RU",
            "tr-TR",
            "uk-UA",
            "zh-TW",
            "id-ID"
        ]
  • Download-URI is now a dictionary, where each entry is indexed by its language code. This allows to support one download per language. If the download contains all available languages at once, the dictionary key is simply a *.

    Example (for all languages in one download):

    Code: Select all

        "Download-URI": {
            "*": "https://mh-nexus.de/downloads/HxDSetup.zip"
        }
    Example (where each language is a separate download):

    Code: Select all

        "Download-URI": {
            "deu": "https://mh-nexus.de/downloads/HxDSetupDEU.zip",
            "ell": "https://mh-nexus.de/downloads/HxDSetupELL.zip",
            "enu": "https://mh-nexus.de/downloads/HxDSetupENU.zip"
        }
  • Unique-File-IDs can now mention several files, so each entry is indexed by the filename (even if there is only one file).

    Example (with just one file):

    Code: Select all

        "Unique-File-IDs": {
            "HxDSetup.zip": {
                "SHA-1": "d0d69744f1d01353507bc090ff79fb45db6882c0",
                "SHA-512": "ea97d98877342d725adcbfa075d5d5770470cf4a1d79477d577d299b6298d62f9a7fec8903633f8adcda7d306bff848751f8c788b611cc2d1074624a9153bc49"
            }
        }
    Example (with several files):

    Code: Select all

        "Unique-File-IDs": {
            "HxDSetupDEU.zip": {
                "SHA-1": "3e4ae6c3a6ab4661cafab3ef62d4ee9608b4eeda",
                "SHA-512": "8d2c9188dcdab5d1168d1e4810ff0e45e9c7b54a3d46cb613067e5e06678ca00863e2cd2c77de30a96c4cbba471bf3de6fc10cf92ff0d4492dcde5536a657847"
            },
            "HxDSetupELL.zip": {
                "SHA-1": "aec1514eccced521d406a6630996a195c7053a0e",
                "SHA-512": "3e4520faaba76186c82d0432d7a3551795c11cddf5cb8f3fbc9f9b5e177c97402a5a0fb582eb2902c58a4e7cb3ba467d2bd3b1344e2ce2dd6c41c89d34c993bf"
            },
            "HxDSetupENU.zip": {
                "SHA-1": "e2c3c761f2d52b754a82709c1b47c5efe9e06417",
                "SHA-512": "b1a5273aa931dba25e6c7c692720fbfd44cb17f9d5758ecd1559f6b8758e42e97af61f2026d22beb748683b889438e78b30f5a19f8c4f6325231d46fb3601d35"
            }
        }

Complete examples of the new file format:

Complete example for HxD 2.5.0.0 where all languages are contained in a single download file:

Code: Select all

{
    "Product": "HxD",
    "Edition": "installable",
    "Development-Stage": "stable",
    "Version": "2.5.0.0",
    "Release-Date": "2021-02-11T00:00:00.000Z",
    "OSs": [
        "Windows XP",
        "Windows 2003",
        "Windows Vista",
        "Windows 7",
        "Windows 8",
        "Windows 10"
    ],
    "Langs": [
        "zh-CN",
        "de-DE",
        "el-GR",
        "en-US",
        "es-ES",
        "fr-FR",
        "hu-HU",
        "it-IT",
        "ja-JP",
        "ko-KR",
        "nl-NL",
        "pl-PL",
        "pt-BR",
        "ru-RU",
        "tr-TR",
        "uk-UA",
        "zh-TW",
        "id-ID"
    ],
    "Unique-File-IDs": {
        "HxDSetup.zip": {
            "SHA-1": "d0d69744f1d01353507bc090ff79fb45db6882c0",
            "SHA-512": "ea97d98877342d725adcbfa075d5d5770470cf4a1d79477d577d299b6298d62f9a7fec8903633f8adcda7d306bff848751f8c788b611cc2d1074624a9153bc49"
        }
    },
    "Download-URI": {
        "*": "https://mh-nexus.de/downloads/HxDSetup.zip"
    }
}
Complete example for HxD 1.7.7.0 where each language was still a separate download:

Code: Select all

{
    "Product": "HxD",
    "Edition": "installable",
    "Development-Stage": "stable",
    "Version": "1.7.7.0",
    "Release-Date": "2009-04-03T00:00:00.000Z",
    "OSs": [
        "Windows 95",
        "Windows 98",
        "Windows ME",
        "Windows NT4",
        "Windows 2000",
        "Windows XP",
        "Windows 2003",
        "Windows Vista",
        "Windows 7"
    ],
    "Langs": [
        "zh-CN",
        "cs-CZ",
        "de-DE",
        "el-GR",
        "en-US",
        "es-ES",
        "fi-FI",
        "fr-FR",
        "hu-HU",
        "it-IT",
        "ja-JP",
        "ko-KR",
        "nl-NL",
        "pl-PL",
        "pt-BR",
        "ro-RO",
        "ru-RU",
        "sk-SK",
        "sl-SI",
        "tr-TR",
        "uk-UA",
        "sv-SE"
    ],
    "Unique-File-IDs": {
        "HxDSetupCHS.zip": {
            "SHA-1": "e193cc70b3424619950bd1444681f754409b4dd8",
            "SHA-512": "01ec71cb00d139637735bf27c692414acfe998a3f970e78fef1a2cfaf3825668b1a859c0965c28b36e25bc2f83ab4bdb15cd0a585cdffc1da6b852fd3a4b2a34"
        },
        "HxDSetupCSY.zip": {
            "SHA-1": "4469f7e43cccaf7b70100f2adf03b4256b36ce06",
            "SHA-512": "3ec75b90446aad24eff8fc2b8e2e47ef8bbe66b733a19fc8f52c870875eaea56c91a6b555c3423a824b5e561733099a04d19edb68f3d939d8dc2cd9749be682e"
        },
        "HxDSetupDEU.zip": {
            "SHA-1": "3e4ae6c3a6ab4661cafab3ef62d4ee9608b4eeda",
            "SHA-512": "8d2c9188dcdab5d1168d1e4810ff0e45e9c7b54a3d46cb613067e5e06678ca00863e2cd2c77de30a96c4cbba471bf3de6fc10cf92ff0d4492dcde5536a657847"
        },
        "HxDSetupELL.zip": {
            "SHA-1": "aec1514eccced521d406a6630996a195c7053a0e",
            "SHA-512": "3e4520faaba76186c82d0432d7a3551795c11cddf5cb8f3fbc9f9b5e177c97402a5a0fb582eb2902c58a4e7cb3ba467d2bd3b1344e2ce2dd6c41c89d34c993bf"
        },
        "HxDSetupENU.zip": {
            "SHA-1": "e2c3c761f2d52b754a82709c1b47c5efe9e06417",
            "SHA-512": "b1a5273aa931dba25e6c7c692720fbfd44cb17f9d5758ecd1559f6b8758e42e97af61f2026d22beb748683b889438e78b30f5a19f8c4f6325231d46fb3601d35"
        },
        "HxDSetupESN.zip": {
            "SHA-1": "39686aa8abe88d36df6f83e1aedaabc4501de59c",
            "SHA-512": "1654095db2521691ce87e8bfb1313c7aec78fc0bfa04214a06802406855a08b86b4740b3199d1d7bb6f919bff639dfc8a2ee60e6cb0757dec3d9b5a121de7250"
        },
        "HxDSetupFIN.zip": {
            "SHA-1": "ddc5dc2c22fc2552f3728170aee33f04f3bc6d28",
            "SHA-512": "a2339a5c1c0239f5ac09dd3979b2912fa43e36da55a6895b3367e804660b1f27c6af908c07f39e1429b734be85fbeb715d5606ede1b83bdb30997f1424e128fb"
        },
        "HxDSetupFRA.zip": {
            "SHA-1": "43100968686daa1f0aaa768d87fd2e2731d1665e",
            "SHA-512": "0166f06b576265c9bfe9bac4d06adaddcea5c6375c87cf0bd5e19780a6d615eb6a27c329e82471d254e4b39f35ce9379773246e8f3bc83ad1ccfe5c66b003c3c"
        },
        "HxDSetupHUN.zip": {
            "SHA-1": "ba494d16e91d0aad3e1d0fc83b7d2f724e0413cf",
            "SHA-512": "2ecb8e4db94b669bb56322879e3274c32c8d2c017b65e499987659e8bdf6c27146a31af78ee8bc62ae6c9afac74b2f6244942d1ae49e3d9a33d5d6e49ba0dba8"
        },
        "HxDSetupITA.zip": {
            "SHA-1": "7efbca44f605e5115e91c2b62d2b15879a35009a",
            "SHA-512": "5a81539844b277db59f62d8f29d5ef05f5d2a28ceec301dcb6a21e92316cb7bc5c88b8f2ea0d333fc8668e27ee8205f84906f02ad5d9bd3882dfd1ed87155cd2"
        },
        "HxDSetupJPN.zip": {
            "SHA-1": "8e884503e161d23a11594a606dd54d379e770a23",
            "SHA-512": "7073a62bca4658a9740e1a745691c13be0852fd03819899d79c4f2af5635b340ef2d8841b271b89dc0bb363a41a334089de03c0b42fe0c59ef197dc22c58d70d"
        },
        "HxDSetupKOR.zip": {
            "SHA-1": "cad8c910c3a31c2fca5b4bfd6e80a97c7bd942cb",
            "SHA-512": "605e37d482dfcd4db56813cca2321224f1821e08c0104a4a250652b31b723fc1ee517a2da3b0afe93d798b9756879541473a60b01b7a87799f37feced82e284d"
        },
        "HxDSetupNLD.zip": {
            "SHA-1": "6857ccee7eea2d31ad2dbc84093a56e0a812cdb5",
            "SHA-512": "92a931b37b6e7bafbba2bd6e221acf39f38c79b681d84253ef95dc5d124bf7c0726fe5ffd1d533f0f2aa915fbac750c6cfe3631bad98daad4841057e44336ed0"
        },
        "HxDSetupPLK.zip": {
            "SHA-1": "6f555247554eec42e432d9ecb7d2cdefa10e7b91",
            "SHA-512": "3ef501061cbcb559375d12c7983592b1d2cb1eb72262cc60a2a80e4de1f3f5f4d011df66d74547e128cfb9b30dd77bb850786c273fdbe991622030d00ac3e0f8"
        },
        "HxDSetupPTB.zip": {
            "SHA-1": "119b442dd40cb98c9c15f0247903327dd14eb50c",
            "SHA-512": "1e0cefed6134e9994dccbe195f1f9b52a1322029be9f58fe4d184513e3f9ee71fe1cad2a952017325159e0d78c0e7031d9efbdb0bccf355a72c24764d1cba981"
        },
        "HxDSetupROM.zip": {
            "SHA-1": "0279fecb170301fc0a1eba3402a1ab80482e3250",
            "SHA-512": "4e97241fc1445d2078a8d9b1cdfa453c3686a63e96ef4a53adef4d231cc6d405397d2bf01f63b771c4ee8a00db0cbb0745d5576787c653984aac6bc45f538ecf"
        },
        "HxDSetupRUS.zip": {
            "SHA-1": "728479ca08405718ea18416a7571fec1b23e3db8",
            "SHA-512": "d74f0d68404a4ca570fc82158110e87e79fa5fa4652d93f73a2920e2b2b2559f8b3c8735f2e43abb53fd5e807d50b86b1452570d072dba5d27622703b4804d56"
        },
        "HxDSetupSKY.zip": {
            "SHA-1": "256ea94a06988c297180d0e68c34af1a00ec9eaf",
            "SHA-512": "12697881351e78b23c11d7d054a6c33c9711f5bdeebae5c65b43ae8bf5978d5c49c7ac41e05319f2f7cc2c3eca60183babb8e26ff5a3da64fda6d23f602fb8e6"
        },
        "HxDSetupSLV.zip": {
            "SHA-1": "4698c57d239872fab90eb2f984a55cc1f92bae37",
            "SHA-512": "f2b41a2b6814252b1eb4c5b15446822ff3975f5629f7e3e3562ab14116c1be338848205d5da2ca7387d34d5cc352b72c2d8253246b52663a9d9ac66c463c721e"
        },
        "HxDSetupTRK.zip": {
            "SHA-1": "5416fcf31a82795bbada64c67abd17dc6ed1bb45",
            "SHA-512": "9f290d3b4dcb214863ac4b663c3b497eb24f164ccae531a4f91bc976ad5cb6a0753564e2ee292ff87957e3520856ef283f3c1a6b1465c652aa1c716414eea06c"
        },
        "HxDSetupUKR.zip": {
            "SHA-1": "2a968cad303cabbc4c8b861c47032b86fa7e36b7",
            "SHA-512": "66598569d03b84bc0429064d25e2a82aea53f372e607d055bd0f7985a0b66dd3fbacbe4b84e61d70e94f246f4457cec515ec7336b011c4e2c5b36a4cbfd6594a"
        }
    },
    "Download-URI": {
        "zh-CN": "https://mh-nexus.de/downloads/HxDSetupCHS.zip",
        "cs-CZ": "https://mh-nexus.de/downloads/HxDSetupCSY.zip",
        "de-DE": "https://mh-nexus.de/downloads/HxDSetupDEU.zip",
        "el-GR": "https://mh-nexus.de/downloads/HxDSetupELL.zip",
        "en-US": "https://mh-nexus.de/downloads/HxDSetupENU.zip",
        "es-ES": "https://mh-nexus.de/downloads/HxDSetupESN.zip",
        "fi-FI": "https://mh-nexus.de/downloads/HxDSetupFIN.zip",
        "fr-FR": "https://mh-nexus.de/downloads/HxDSetupFRA.zip",
        "hu-HU": "https://mh-nexus.de/downloads/HxDSetupHUN.zip",
        "it-IT": "https://mh-nexus.de/downloads/HxDSetupITA.zip",
        "ja-JP": "https://mh-nexus.de/downloads/HxDSetupJPN.zip",
        "ko-KR": "https://mh-nexus.de/downloads/HxDSetupKOR.zip",
        "nl-NL": "https://mh-nexus.de/downloads/HxDSetupNLD.zip",
        "pl-PL": "https://mh-nexus.de/downloads/HxDSetupPLK.zip",
        "pt-BR": "https://mh-nexus.de/downloads/HxDSetupPTB.zip",
        "ro-RO": "https://mh-nexus.de/downloads/HxDSetupROM.zip",
        "ru-RU": "https://mh-nexus.de/downloads/HxDSetupRUS.zip",
        "sk-SK": "https://mh-nexus.de/downloads/HxDSetupSKY.zip",
        "sl-SI": "https://mh-nexus.de/downloads/HxDSetupSLV.zip",
        "tr-TR": "https://mh-nexus.de/downloads/HxDSetupTRK.zip",
        "uk-UA": "https://mh-nexus.de/downloads/HxDSetupUKR.zip"
    }
}
Maël
Site Admin
Posts: 1455
Joined: 12 Mar 2005 14:15

Re: Documentation for HxDCurrentVersion.json

Post by Maël »

Locale names:
Generally follow the pattern <language>-<REGION>. language is an ISO 639-1 language code if available for that language, otherwise it is an ISO 639-2/T language code. REGION is an ISO 3166-1 country/region identifier.

REGION is in all uppercase to clearly differentiate it from Script, which starts with an uppercase letter, and is used in these two other valid patterns for locale names: <language>-<Script> and <language>-<Script>-<REGION>.

The locale name pattern can be more complex, such as <language>-<Script>-<REGION>\_<sort order> or <language>-<Script>-<REGION>-x-<custom>, but each part of the locale name can be identified/removed based on its casing or special characters (leading underscore for sort order, -x- for the <custom> part).

Edit: Apparently identifying/removing parts simply using casing info is not correct, the formatting is just a recommendation, but cannot be relied upon, instead rules are more complex and outlined in RFC 5646, BCP 47.
There are different types of subtag, each of which is distinguished by length, position in the tag, and content: each subtag's type can be recognized solely by these features. This makes it possible to extract and assign some semantic information to the subtags, even if the specific subtag values are not recognized. Thus, a language tag processor need not have a list of valid tags or subtags (that is, a copy of some version of the IANA Language Subtag Registry) in order to perform common searching and matching operations. The only exceptions to this ability to infer meaning from subtag structure are the grandfathered tags listed in the productions 'regular' and 'irregular' below. These tags were registered under [RFC3066] and are a fixed list that can never change.
based on information from the linked resources above and from https://learn.microsoft.com/en-us/windo ... cale-names
Note: difference between CultureInfo.Name and LOCALE_SNAME is not significant.

CultureInfo.Name refers to ISO 639-3, instead of ISO 639-2/T, which LOCALE_SNAME/"Locale Names" refers to. However this is not a problem since "[ISO 639-3 is] the same as 639-2/T for languages, but with distinct codes for each variety of an ISO 639 macrolanguage", see Wikipedia.
Note: "Locale Short String" is outdated and apparently comes from old MSDN documentation titled "Visual Basic Scripting Edition -- Locale ID (LCID) Chart", which is hard to find online now (a pitty MS removed most old documentation, since sites/programs/docs still refer to them and it creates confusion.).
"Locale Short Code" is probably a related term inspired by the use of "code" to name the subtags that follow ISO specs.
Language tag is definitely the preferrable term for modern use, as most will follow the BCP 47 standard, which uses this term.
Note (Windows/Embarcadero bug?): Some locale names do not seem to have valid syntax, according to the BCP 47 standard, which clearly states (in all its revisions) that the language sub tag always comes first, with only a set of fixed exceptions called grandfathered registration, and private use (which start with "x").
But Cy-sr-SP clearly violates the BCP 47 syntax, even when considering the exceptions. It stands for Serbian (Cyrillic) - Serbia and LCID 0x0C1A. Cy is a script (Cyrillic) and should come as second sub-tag, not first, and should also be written as sr-Cyrl-CS. So the country code is not SP (which does not exist and was never assigned in ISO_3166, not even temporarily) but CS. Must be some legacy issue with Windows or a faulty documentation of Embarcadero.

When using this PowerShell snippet [CultureInfo]::GetCultureInfo(0x0C1A).Name under Windows 8, you get sr-Cyrl-CS, which looks better. The country code seemed non-existant in this Wikipedia article ISO 3166 country codes, but is mentioned in ISO 3166-1 alpha-2 as legacy. So this result seems correct.

Edit: It seems to be rooted in a mistake in older .NET versions, where it is still called "Culture code", which was based on RFC 1766. However RFC 1766 doesn't seem to allow this syntax either..., I wonder where this mistake comes from.
I could not convince .NET to produce the erroneous Cy-sr-SP (oldest I had was .NET 2.0 on Windows 8 ), eventhough much more recent code from 2017 seems to have the same issue. Another example of faulty .NET language tags. This seemed to be a documentation error left over from .NET 1.0/1.1 times, until I looked at the .NET source code that has this comment for CultureInfo.Name: "[CultureData.SNAME] Expected this.sName to be populated by COMNlsInfo::nativeInitCultureData already"), which most likely refers to LOCALE_SNAME. But on Windows Vista LOCALE_SNAME returns the correct value, and LOCALE_SNAME did not exist on XP. So maybe it is a custom implementation on older .NET versions that were faulty, or some service pack fixed it on Vista. Mysterious.

Delphi uses LocaleData.INC which has a line mentioning the LCID 0x0C1A (ID:$0C1A; List:'sr-Cyrl-CS'), and gives the correct language tag as can be seen. So despite the faulty Embarcadero documentation, the code seems to be fine (at least in System.pas).
Further references:
https://docwiki.embarcadero.com/RADStud ... ISO_Values
https://community.inriver.com/hc/en-us/ ... ture-Names
https://lonewolfonline.net/list-net-cul ... try-codes/
https://ss64.com/locale.html (mentions a PowerShell script to automatically generate a list of locale names, but uses wrong terminology (see note above about "locale short codes/strings"),and refers to the outdated CultureInfo.IetfLanguageTag property, when CultureInfo.Name should be used)
Post Reply