EntityScript

Draft 1.2:
Index


core_language





"""
Copyright (C) 2020 New Entity Operations Inc.

ALL RIGHTS RESERVED

core_language can serve as a language check script and enforcement mechanism.

If you decide to build in comparison driven-verfication methods, you can extend these setup
classes to compare on the fly data strings and with known system languages and file types.

"""
from core_middlelayer import (
    COPYRIGHT,
    language_code
)

class LANG_PROPAGATE():
    """
    International Language Propogation logic. Not everything is here right now but the spot is
    established for additional language options.
 
    Eventually, all the core interface elements will be mapped to language objects of either a
    default or customized type/kind.
    >>> import core_language
   >>> # Create a LANG mapping object (simple)
    >>> core_language.LANG_PROPAGATE('en')
    

    """
    def __init__(self, language_code):
        """
        LANG_PROPAGATE() must run at the bottom of the script each time a language mapping
        occurs. This will need to be invoked each time an elemented is mapped to the language
        definition.

        You can use a default setup/skeleton to populate chosen attributes using the following model
        a.) Base language: en
        b.) Base language: en MAPPED-TO-> Sub-language: LANGUAGEX

        There shouldn't be text pulled into the FRONTEND interface that doesn't first do a language
        lookup. This isn't in the system now but this is only needed in cases of enforcing and
        checking various system and file language structures.

        Language and other types of encoded variables should arrive here by
        representation ONLY. This transition should be occuring on formatted strings only.

        This is the skeleton code

        """
        if language_code == 'en':
            self.PROPAGATE_ENGLISH()
        elif language_code == 'es':
            self.PROPAGATE_SPANISH()
        else:
            print("No other languages are offered in the preview build")

    def PROPAGATE_ENGLISH(self):
        """
        Base language: en
        """
        LANG_PROPAGATE.COPYRIGHT = COPYRIGHT

    def PROPAGATE_SPANISH(self):
        """
        Base language: en to Sub-language: es
        """
        LANG_PROPAGATE.COPYRIGHT = 'Derechos de autor'

LANG_PROPAGATE(language_code)



Return HOME