Comments (8)
If we think about implementing more URL styles in the future, we could also use one setting to define the URL type, like routing_style
: [default/hide_default/domain/...]
from translate.
@madc: My original idea was that the default "automatic" routing would be for users who just wanted to get started without all the configuring, so I made it disableable so that one could do hostname based or other types of routing in the routing.yml file, but if we can implement a routing_style
option that works well that'd be great!
The hide_default_slug
style is easy to automatically make the actual routing for, but the issue will be to make bolt "get" that the same record should get different link styles based on a parameter bolt basically does not "care about" IIRC.
So, I'm all for this if we can get it to work well :) One thing to take into consideration is that everything we do in many parts basically has to be implemented in both legacy and proper storage since legacy is used on the frontend and proper is used on the backend.
from translate.
I'm totally with you on that. The default configuration should reflect the usual use case and work right out of the box. Thing is, I'll have to take some time soon to implement this and I'm sure, its interesting for other users too.
I'd suggest to implement the routing_style
option, even if it just toggles the default language slug for now. Do you agree?
from translate.
Yeah, routing_style
gives us the freedom to add different styles in the future, so that sounds good!
If you have any questions/notes/criticism about/of my code please just throw them out there and I'll answer ASAP :)
from translate.
Believe me, I'm not the guy holding back on criticism.. .. as for questions, they will come for sure.
I'll touch this thing the week after next one. Meanwhile, if you have any thought on the topic, just throw them in here..
from translate.
Just a quick heads up: I'm currently working on this feature here: madc/bolt-translate
from translate.
I think I have this working just by setting my own route. But it's only a very simple single-page site with only one contenttype.
/app/config/routing.yml
# first route
templatebinding:
path: /{_locale}
defaults:
_controller: controller.frontend:template
template: index
requirements:
_locale: '(en|fr|ru)'
# also need the default homepage route
homepage:
path: /
defaults:
_controller: controller.frontend:homepage
All options in translate.animal.yml are set to false.
from translate.
While this is possible with some routing hacks like @benwallis mentioned, I don't think we can do it on a larger scale as long as we do prefix routing. Basically we can't check for the locale when building the routing, so we can't exclude the locale then (sorta a catch-22 problem) and we can't have optional parameters before required ones so we can't make the locale optional since the rest of the route params need to be required. If we did suffix routing like /page/about-us/en instead we could do it, but that looks really ugly and can be done in ones own routing if one prefers.
Closing for now, if we find a way to do it we can reopen.
from translate.
Related Issues (20)
- Provide a short documentation about "how it works" HOT 1
- [BUG] Changelog is impossible to follow HOT 4
- Change the DB structure - use a table for translation HOT 2
- Arbitrary localized columns for searching
- translatable: true works but translatable: 1 not
- Redirecting homepage to subdomain HOT 1
- [BUG] No language switcher in contenttype when no tabs are present
- [RFC] Make language switcher on contenttype new pages configurable
- [RFC] Twig_Error_Runtime after updating to Translate 4.1.5 HOT 1
- Any page not preceded by '/contenttype' will switch website to default language HOT 1
- [RFC] Translate taxonomies HOT 2
- [BUG] saving with templatefields throws: Warning: Invalid argument supplied for foreach() HOT 1
- [BUG] status update deletes localized contents HOT 1
- Translations are not saved ? Missed a configuration ? HOT 9
- [RFC] Implementing a routing override blacklist
- Redirect ALL urls to default locale HOT 1
- [RFC] Remove /en slug from URL if default language is en_GB
- [BUG] Error when updating php7.2 -> php7.4 (but I found a trick) HOT 1
- [BUG] Composer error
- [BUG] repeater field is set to a row prior when there's no translation being set on the current row
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from translate.