Skip to content

fkemser/SHtemplateLIB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues GNU GPL v3.0 License


SHtemplateLIB

A library containing constants and functions for SHtemplate repository.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Documentation
  3. Roadmap
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgments

About The Project

This repository provides constants and functions that are exclusively used within SHtemplate repository such as

  • language-specific text snippets like help texts, interactive dialogues, terminal/log messages, and
  • functions, e.g. the semi-automatic creation of the script's help.

(back to top)

Documentation

For better code readability and maintenance the library is divided into multiple files:

/lib/ / Description
licenses
... <lic>.txt License header files where <lic> is the license's SPDX-License-Identifier. Used by lib_shtpl_about() function.
shtpl.0.lib.sh Contains language-independent strings and all the library's functions
shtpl.<ll>.lib.sh Contains language-specific strings (translations), e.g. shtpl.en.lib.sh for English strings

(back to top)

shtpl.0.lib.sh

This file contains language-independent strings and all the library's functions.

⚠️ The following table only gives a brief overview. Before using any of these functions please have a look at the comments in the source file.

Function Description
lib_shtpl_about Print about message (project, author, copyright, license, etc.)
lib_shtpl_arg Generate/Format script's help. Only for script parameters (help's SYNOPSIS section), for other help sections see lib_shtpl_genhelp() instead.
lib_shtpl_arg_action_is_valid Check if arg_action (see /src/run.sh) is valid
lib_shtpl_arg_error Log/Print an error message for a certain argument
lib_shtpl_arg_is_set Check if one or more arguments are set (not empty)
lib_shtpl_genhelp Generate/Format script's help. For all help sections except script parameters (see lib_shtpl_arg() instead).
lib_shtpl_help Print help message using less utility
lib_shtpl_message Log/Print error/info/warning message and optionally exit

(back to overview)

shtpl.<ll>.lib.sh

These files contain language-specific strings. For each supported language there is one (separate) file where <ll> in the filename is the language's ISO 639-1 ID in lowercase letters, e.g. shtpl.en.lib.sh contains English strings, shtpl.de.lib.sh German strings, etc.

ℹ️ In case your language is not supported yet: Please have a look below.

(back to overview)

Adding support for other languages

In case your language is not supported yet please follow these steps:

  1. Just copy the English translation file /lib/shtpl.en.lib.sh and rename the copy by replacing en with your language's ISO 639-1 two-letter code (lowercase), e.g. to shtpl.es.lib.sh for a Spanish translation file.

  2. Open the renamed file and use your editor's Search & Replace feature to replace each constant's LIB_SHTPL_EN_ prefix by your language's ISO 639-1 two-letter code (uppercase), e.g. to LIB_SHTPL_ES_ for Spanish.

  3. After renaming just translate constant by constant into your own language.

  4. Finally have a look at SHtemplate's readme for further project-specific instructions.

ℹ️ To contribute your translation to this project, please have a look at the Contributing section.

(back to overview)

Roadmap

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the GNU Lesser General Public License v3.0 (or later). See LICENSE for more information.

(back to top)

Contact

Project Link: https://github.com/fkemser/SHtemplateLIB

(back to top)

Acknowledgments

(back to top)

About

SHtemplate Library Files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages