Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert: DAB: Parse Specific Config #676

Open
chrisvire opened this issue Sep 10, 2024 · 1 comment
Open

Convert: DAB: Parse Specific Config #676

chrisvire opened this issue Sep 10, 2024 · 1 comment
Assignees

Comments

@chrisvire
Copy link
Member

chrisvire commented Sep 10, 2024

SAB and DAB share a lot of the same config, but there will be parts that are unique to DAB.

The main data elements in a DAB project are:

    <database-filename>data.sqlite</database-filename>
    <lexicon-db type="flex-xhtml" />

The main data elements in an SAB project are:

    <books id="C01">
        <book-collection-name>World English Bible</book-collection-name>
        <book-collection-abbrev>web</book-collection-abbrev>
        <book-collection-description></book-collection-description>
        ...
    </books>

You will need to make the convert/convertConfig.ts file work with both types. The way that you tell which is which is in the <app-definition> tag:

<app-definition type="DAB" program-version="12.1">

The writing-system entries in DAB are more complex that what is in SAB.

Here is an example writing-systems from the Hanga project:

    <writing-systems>
        <writing-system code="hag-Latn-GH-fonipa-x-emic" type="main|gloss">
            <display-names>
                <form lang="default">Hanga</form>
            </display-names>
            <font-family>font-hag-Latn-GH-fonipa-x-emic</font-family>
            <trait name="text-direction" value="LTR"/>
            <trait name="indexed" value="false"/>
            <sort-method type="none">
                <ignore-chars>- = ~ * ( ) [ ] ¡ ¿</ignore-chars>
            </sort-method>
            <alphabet>a b ch d e f g gb h i j k kp l m n ny ŋ ŋm o p r s t u v w y z</alphabet>
            <input-buttons>a b ch d e f g gb h i j k kp l m n ny ŋ ŋm o p r s t u v w y z</input-buttons>
            <features type="writing-system">
                <e name="summary-gloss" value="true"/>
            </features>
        </writing-system>
        <writing-system code="en" type="gloss">
            <display-names>
                <form lang="default">English</form>
            </display-names>
            <font-family>font-en</font-family>
            <trait name="text-direction" value="LTR"/>
            <trait name="indexed" value="true"/>
            <sort-method type="none">
                <ignore-chars>- = ~ * ( ) [ ] ¡ ¿</ignore-chars>
            </sort-method>
            <alphabet>a b c d e f g h i j k l m n o p q r s t u v w x y z</alphabet>
            <reversal-filename>Hanga dictionary reversals.xhtml</reversal-filename>
        </writing-system>
    </writing-systems>

Here is an example writing-systems from SAB:

        <writing-systems>
            <writing-system code="en" type="interface">
                <display-names>
                    <form lang="en">English</form>
                    <form lang="fr">Anglais</form>
                    <form lang="es">Inglés</form>
                    <form lang="de">Englisch</form>
                </display-names>
                <font-family>system</font-family>
                <trait name="text-direction" value="LTR"/>
            </writing-system>
            <writing-system code="fr" type="interface">
                <display-names>
                    <form lang="en">French</form>
                    <form lang="fr">Français</form>
                    <form lang="es">Francés</form>
                    <form lang="de">Französisch</form>
                </display-names>
                <font-family>system</font-family>
                <trait name="text-direction" value="LTR"/>
            </writing-system>
            <writing-system code="de" type="interface">
                <display-names>
                    <form lang="en">German</form>
                    <form lang="fr">Allemand</form>
                    <form lang="de">Deutsch</form>
                    <form lang="es">Alemán</form>
                </display-names>
                <font-family>system</font-family>
                <trait name="text-direction" value="LTR"/>
            </writing-system>
            <writing-system code="es" type="interface">
                <display-names>
                    <form lang="en">Spanish</form>
                    <form lang="fr">Espagnol</form>
                    <form lang="es">Español</form>
                    <form lang="de">Spanisch</form>
                </display-names>
                <font-family>system</font-family>
                <trait name="text-direction" value="LTR"/>
            </writing-system>
        </writing-systems>

So you can see there is a different "type" (interface or gloss) and additional optional properties.

@chrisvire chrisvire changed the title Parse DAB Specific Config DAB: Parss Specific Config Sep 13, 2024
@chrisvire chrisvire changed the title DAB: Parss Specific Config DAB: Parse Specific Config Sep 13, 2024
@chrisvire chrisvire changed the title DAB: Parse Specific Config Convert: DAB: Parse Specific Config Sep 24, 2024
@chrisvire
Copy link
Member Author

In DAB 12.2, there has been a change in how to determine if there will be index files (surprise to me).

Prior to DAB 12.2, there was a <trait name="indexed" value="true|false"> in the <writing-system> element.
In DAB 12.2, that has been pulled out into a separate configuration.

    <indexes>
        <index lang="en" displayed="true"></index>
        <index lang="hag-Latn-GH-fonipa-x-emic" displayed="false"></index>
    </indexes>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

No branches or pull requests

4 participants