Comments (2)
For anyone else who's come to face the same issue, I managed to make a workaround. Basically, you create additional taxonomies that end with '_locale' (e. g. _es for Spanish). So you have both 'categories' and 'categories_es', both 'tags' and 'tags_es'. Then you modify your _sub_taxonomylinks.twig in the following way (I use subdomain approach, use your own conditions that suite you). This allows to only show language-specific taxonomies depending on the url of the website.
<div class="tags">
{% for type, values in record|taxonomy %}
{% set domain = app.request.getHttpHost() %}
{% if ((domain == 'es.domain.com') and '_es' in type) or ((domain == 'en.domain.com') and '_es' not in type) %}
<span class="label">
{% if values|length < 2 %}
{{ config.get('taxonomy')[type].singular_name }}:
{% else %}
{{ config.get('taxonomy')[type].name }}:
{% endif %}
</span>
{% for link, value in values %}
<a href="{{ link }}" class="tag is-dark">{{ value }}</a>
{% else %}
{{ __('general.phrase.none') }}
{% endfor %}
{% endif %}
{% endfor %}
</div>
from translate.
Well, another option is to just use Labels. At the time of submitting this RFC I wasn't fully aware that it's capable of doing this on its own. But the above method could still be useful for those who want to have taxonomy links different for other languages.
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
- [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.