Neos how can i check which language is actually selected? TypoScript? Flow?
If English then output tabelle_EN. If German then output table_DE.
First you edit setting.yaml of site package(If the site name is 'example',Then package\Sites\TYPO3.ExampleDemoTypo3Org\Configuration\Settings.yaml).
TYPO3:
TYPO3CR:
contentDimensions:
'language':
label: 'TYPO3.ExampleDemoTypo3Org:Main:contentDimensions.language'
icon: 'icon-language'
default: 'de'
defaultPreset: 'de'
presets:
'all': ~
'de':
label: 'German'
values: ['de', 'en', 'it']
uriSegment: 'de'
'en':
label: 'English'
values: ['en', 'de', 'it']
uriSegment: 'en'
'it':
label: 'Italiano'
values: ['it', 'fr','de']
uriSegment: 'it'
The above mentioned code is the normal typo3 Neos language settings. The content in the language selector menu will appear based on the above selector.
If you want to get currently selected (used) language identifier (locale), then you can get it in a fluid template using the below mentioned code.
{node.context.targetDimensions.language}
If you select german language using language selector, the above code gives the answer 'de'. It is my humble suggestion that, please avoid locale value like 'tabelle_EN', and table_DE etc.. This locale identifier is mainly used for translation purpose in Multilanguage sites.
Related
I try to create my extension. The extension is called personal. So I use the personal_ prefix for the CType.
TYPO3 has version 11.5.23
For the dropdown, I think the only thing I have to do is to create the tt_content.php
I tried this guide:
https://docs.typo3.org/m/typo3/reference-coreapi/11.5/en-us/ApiOverview/ContentElements/AddingYourOwnContentElements.html
Configuration/TCA/Overrides/tt_content.php
// Add the content element to the "Type" dropdown
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
'tt_content',
'CType',
[
'Titel',
'personal_titel',
'content-text',
],
'textmedia',
'after'
);
But when I choose it from the wizard, the CType is unknown.
Had that behaviour once i had limited the allowed CEs of the content column (maybe you use grielements or sth elese).
I had to explicitly allow my CE in the content column config and after clearing the cache it worked. Maybe it helps in your case, too?
The indexed_search pagination outputs links like "Page 1, Page 2, Page 3"
Is there any way to edit it to remove the word 'Page' so the output is just the numbers?
<is:pageBrowsingResults numberOfResults="{result.count}" currentPage="{searchParams.pointer}" resultsPerPage="{searchParams.numberOfResults}" />
I just looked into the code and saw that the page label is fetched from the locallang with index displayResults.page.
With plugin.tx_indexedsearch._LOCAL_LANG.en.displayResults.page = and without a string behind the = it should work.
The en is for the language key, you need to set it for every language.
The documentation you can find here:
https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/TopLevelObjects/Plugin.html#local-lang-lang-key-label-key
From Typo3 10 onwards we have no pagination HTML template, instead Typo3 has provided ViewHelper for PageBrowser.
So, We can extend that viewhelper in our Template provider extension and edit as per our needs.
I am currently trying to implement a contact form in Neos 1.2.5, but the error messages don't get translated.
With activated content dimensions the translation of the error messages just worked fine. but we had to remove the content dimensions due to German being the only site language (and the unwanted url suffix /de, which seemed to be unremovable with activated content dimensions).
I now added the translationPackage option to my form and copied over the translation files to my site package (into /Resources/Private/Translations/de/ValidationErrors.xlf and /Resources/Private/Translations/en/ValidationErrors.xlf), but it doesn't seem to use any of my translations even when I copy the German translation into the /en folder.
TYPO3:
Form:
yamlPersistenceManager:
savePath: 'resource://vendor.package/Private/Form/'
presets:
default:
title: 'Default'
formElementTypes:
'TYPO3.Form:Base':
renderingOptions:
translationPackage: 'vendor.package'
I also added the defaultlocale to my sitewide settings.yaml:
TYPO3:
Flow:
i18n:
defaultLocale: 'de'
but still no effect. how do I translate my form error messages to German without using content dimensions?
I would update to Neos 2.1. Besides many improvements, you are able to have an uriSegment who is empty for default presets. In that way, you are able to have an german language content dimension without the 'de' in the url. Dmitri Pisarev did a great job on this: https://github.com/neos/neos-development-collection/pull/244
Is there a way to change spell checker language menu with selected language?. I have a language list drop down and when user change this drop down value to other language I wanted to change spell checker's language drop down with selected language.
I am not definetly sure, but it might be necessary to reinit your tinymce then.
You can try to change the language attribute of the tinymce iframe body element, this might be sufficient.
So you do on dropdown change something like:
var language = 'fr'; // language: 'en', 'fr', 'de', ...
ed = tinymce.get('your_editor_id')
var $body = $(ed.getBody());
$body.parent().attr('lang', language);
My problem was solved. I am posting the solution if any one facing the same.
tinymce.EditorManager.execCommand('mceRemoveControl',true, tinyMCE.activeEditor.id);
then I have reintiated the tiny mce(i.e tinyMCE.init({....});)
Can anyone tell me how to easily implement auto-complete in rails 3.1?thanks. p.s. What's the best solution for simple_form to do this??
Besides, I also want to know how to implement meetup's RSVP instant push in rails?
I have the following form, but it didn't work, please advise.
%table
= simple_form_for(#book) do |f|
%th book name
%th
= f.input :name, label: false, placeholder: "add a name", :wrapper_html => { :id => 'autocomplete' }
= f.input :object, autofocus: true, label: false
%th
= f.button :submit, "Yes!"
I built a simple Rails 3.1 app using the jQueryUI autocompletion feature here. You simply add the jQueryUI library to your assets, add a css class or id to the actual text field that shall be autocompleted and put some javascript logic in your application, like:
$(function() {
$('#autocomplete').autocomplete({
source: '/movies/autocomplete'
});
});
with #autocomplete the css id of the text field. '/movies/autocomplete' is the actual route that will HTTp requested with the data that's put into the text field. In the movies#autocomplete action you then use that param to search for data for the autocompletion. Depending in what kind of jQueryUI autocompletion you use, you simply return an array like [{:label => 'FOO', :value => 'foo'}, ...] as JSON. label is the text you get autocompleted, value is the text that is put into the text field when clicking the label. I think and hope the code from the repo is quite understandable. Also, have a look at the JQueryUI library.
Though there shouldn't be a problem with simple_form, since it's just the text field that gets touched.
Best regards
Tobias