About the ShipLang framework
The first multilingual technology stack designed for AI, allowing developers to focus on the product itself.
Framework Introduction and Ideals
ShipLang is the first technology stack developed by product managers, born from a reflection on traditional development processes. In the AI era, what we need is not more complex tools, but simple solutions that allow people to focus on product ideas.
The core ideal of this framework is to make globalization no longer a burden on products. Once you've written the code in Chinese, users around the world can access your website in their native language. Multilingualism should be automatic and intelligent, rather than requiring the manual maintenance of dozens of translation files.
ShipLang is completely free and open source. This is not only about sharing technology, but also an attempt to explore human agency in the AI era. Technology should serve creation, not become an obstacle to it.
Our system is designed for non-programmer users and is compatible with both user and AI usage habits, as shown in the diagram below:
About the author
Technical Principles
Multilingual intelligent translation mechanism
The goal of multilingual support is to ensure that when you type Chinese in the code backend, users see other languages.
The principle is that when a user visits for the first time, the system checks the user's language settings. If no translation file for that language exists, the system calls the translation API, translates the language, displays the translated result on the page, and caches the result on the server for future use. If a translation file for the corresponding language already exists, it is loaded directly, and the page language is automatically displayed.
Workflow
1. When a user visits a page, the system automatically detects the browser's language preference.
2. Check if the server already has a translation cache file for that language.
3. If the cache exists, load and render it directly; otherwise, call the AI translation API.
4. After translation, save it to the server cache for direct use on next visit.
5. The entire process is transparent to the user, requires no waiting, and provides a smooth experience.
User Guide
Basic usage
If there is content that needs to be translated into multiple languages, add the data-i18n tag to the corresponding PHP file.
For example, if you want to translate the Chinese "欢迎用" (Welcome to use) into multiple languages on the langany.com/docs/lang-i18n webpage, you need to add the following to the corresponding PHP file:
<p data-i18n="welcome">欢迎使用</p>
When the user is using the English interface, "Welcome" will be displayed at the corresponding location in langany.com/docs/lang-i18n.
Tag reuse mechanism
When adding multilingual data-i18n tags, you can copy the tags you used before and only modify the text; there is no need to redefine the data-i18n tags.
For example, if the tag for "你好" is defined as "k", then "你好" on the page will be automatically translated as "hello" in English. If you also want to translate "不错" (not bad) into multiple languages, you can directly copy the tag:
<p data-i18n="k">你好</p>
<p data-i18n="k">不错</p>
Currently, in all systems on the market, the same tag is translated into the same content. However, in ShipLang, the system supports reusing data-i18n tag values. When multiple elements use the same tag but have different content, the system automatically converts them to k_你好 (hello) or k_不错 (not bad), ensuring that the translation accurately matches the original text.
Keep the original text
If certain text on the page does not need to be translated and should remain in its original Chinese state, then the data-i18n tag should not be added to that text.
Manually edit the translation
If you are not satisfied with the automatically translated content, you can manually modify the translation:
1. Locate the data-i18n tag value in the HTML file where you want to modify the content.
2. Search for the tag in the corresponding language's JSON file.
3. Edit the translation and save.
For example, to modify the English translation of "1. Hello" in https://langany.com/refund, find the tag section1_title, search for it in lang/en/docs/refund.json and modify it.
Frequently Asked Questions
Why choose PHP as the backend language?
PHP is easy to deploy, inexpensive, and has a mature ecosystem, making it ideal for rapid deployment and iteration. For independent developers and small teams, the combination of PHP and virtual hosting allows you to serve global users at minimal cost. ShipLang's goal is to lower the barrier to entry, not to chase after trendy technologies.
How can the translation quality be guaranteed?
ShipLang uses an industry-leading AI translation API, achieving professional-level translation quality. For critical content, you can manually modify the translated files at any time. Importantly, translations are cached permanently after a single submission, eliminating duplicate API call charges.
Which languages are supported?
Theoretically, it supports all major languages worldwide. The system will automatically match based on the user's browser language preferences, including but not limited to English, Japanese, Korean, French, German, Spanish, Arabic, and over 100 other languages.
How long does the first translation take?
When a user first accesses a new language, the translation typically takes 1-3 seconds. Subsequent accesses to that language will be directly loaded from the cache, with speeds identical to regular web pages. For websites with a large user base, it is recommended to pre-generate translation files for commonly used languages.
How do I update the translated content?
There are two methods: one is to directly modify the JSON file in the corresponding language, and the other is to delete the old translation cache, and the system will re-translate it on the next visit. For pages with frequently updated content, it is recommended to use a version management mechanism.
What are the advantages of tag reuse mechanisms?
Traditional multilingual systems require each translated piece of content to have a unique tag, leading to difficulties in tag naming and management. ShipLang allows you to reuse tags, and the system intelligently identifies content differences. This greatly improves development efficiency; you no longer need to rack your brains for tag names.
What types of projects is ShipLang suitable for?
ShipLang is particularly suitable for projects requiring rapid globalization, such as SaaS products, marketing landing pages, e-commerce websites, and content platforms. If you want to reach the global market with minimal cost, ShipLang is the ideal choice. For large enterprise applications, ShipLang can also be used as a rapid prototyping tool.
Why is ShipLang said to be designed for the AI era?
In the AI era, translation should no longer be a labor-intensive task. ShipLang fully leverages AI's capabilities to automate and intelligently transform translation. Furthermore, its streamlined architecture facilitates the future integration of more AI functionalities, such as intelligent content generation and user behavior analysis.
Getting Started with ShipLang
The framework is completely open source; you are free to use, modify, and distribute it. We believe that in the AI era, technology should be open, easy to use, and serve creators.
If you agree with this concept, you are welcome to join the ShipLang community and explore new paradigms for product development in the AI era.