So I'm really overwhelmed and not quite sure how to start translating my page.
It's not a blog page, so I don't need to translate "articles", though my page is full of little text that describes the service.
What are the best practices for handling longer text? Should I just save it in the "/lang/{languagecode}/{languagecode}.json file? Wouldn't it be too bloated?
How would you handle subdomain path? like de.myapp.com but myapp.com would be in english?
And what is with Vue? where would you store the information?
Thank you and sorry for the nooby question.
For subdomain path Laravel and maybe Lumen have a routing pattern design specifically for subdomain content.
here is the snippet taken from the laravel 5.6 documentation:
Sub-Domain Routing Route groups may also be used to handle sub-domain routing. Sub-domains may be assigned route parameters just like route URIs, allowing you to capture a portion of the sub-domain for usage in your route or controller. The sub-domain may be specified by calling the domain method before defining the group:
Route::domain('{account}.myapp.com')->group(function () {
Route::get('user/{id}', function ($account, $id) {
//
});
});
If you was to replace {account} with your language en, fr, de etc and myapp.com with your top level domain then you could use the language as set by your subdomain in this snippet {account} in your controller to dictate what data it grabs from your database or api.
Thank you for your reply! So I have created my own package for that. Since I could not find what I wanted elsewhere.
Glad to hear you have created a open source package I have added it to my Githubs watch list. Best of luck with your application
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community