I currently use formatPlural() to translate comment (not comments) and return its value to the Twig template.  \Drupal::translation()-&gt;formatPlural('', '1 comment', '@count comments');    Is there any way to use code similar to the following one in a Twig template to translate this word?  {{ 'comment'|trans }} {{ 'comment'|t }} {% trans %}comment{% endtrans %}
122345
I am working on a (my first) Drupal 8 project witch is a multilingual site. Drupal 8 really delivers in terms of native support for content translation.  However, I have a few strings set directly in some if the theme .Twig template files printed out like ex.   {{ 'Read more'|trans }}   I am really stuck on where to handle the translation for strings like these within the Drupal 8 installation.  What steps do I need to take to be able to translate these strings into the language currently selected for on the site? Do I need any additional modules other than the ones included in Drupal 8 core?  Steps I have taken:   Activated the Content Translation &amp; Interface Translation modules Added Twig strings like {{ 'Read more'|trans }} Flushed cache and refreshed pages containing the strings Checked admin/config/regional/translate for the strings with no result
75068
Based on  I shouldn't need to give the lang- prefix when specifying a language for a tag, however this doesn't appear to be the case for CSS.  This is the result of specifying just &lt;!-- language: css --&gt; on a block of code:    Notice how the IDs (#) are being treated as comments rather than style declarations, and there is no nice formatting on the property names.  This is the result of specifying &lt;!-- language: lang-css --&gt; on the same block of code:    I'm not 100% sure if this is a problem, but if it is: can this be fixed?
28318
I'm trying to format numbers. Examples:  1     =&gt; 1 12    =&gt; 12 123   =&gt; 123 1234  =&gt; 1,234 12345 =&gt; 12,345   It strikes as a fairly common thing to do but I can't figure out which filter I'm supposed to use.  Edit: If you've a generic Python way to do this, I'm happy adding a formatted field in my model.
29340
I'm using Babel for writing a document in spanish.  However, it uses a comma instead of a period as a decimal marker (i.e. 3,14 instead of 3.14).  Is there any way to reverse the behaviour? I prefer the period, as it's done in english.   Also, I'd prefer it if it's something that can just be added to the preamble, instead of having to do it each time I want to write a number with a decimal part (like putting the period between brackets, for instance).
66745
I'm using the Message module on Drupal 7.  For Replacement tokens, the help text says:     A comma-separated list of replacement tokens, e.g. %title or !url, of   which the message text makes use of. Each replacement token has to   start with one of the special characters "@", "%" or "!". This   character controls the sanitization method used, analogously to the   t() function.   What's the difference between %, !, and @?  Are there standards about when I should use each symbol?
39023
Let's say I create a function in a module file:  function _get_test() {   return 'test'; }   How can I call this in any Twig file? For example *.html.twig, page.html.twig, node.html.twig etc.   OR   How can I pass a variable from PHP to Twig and display in any Twig file.  For example *.html.twig, page.html.twig, node.html.twig etc.
114350
I've created a theme at underscores.me and it seems it is multi-language ready.  There is a .pot file in the language folder, so I downloaded POEdit and translated the things in there (like Posted on, Edit, 1 Comment, x Comments and so on)  Are the above posted words not from the theme but from Wordpress? If so, why it is in English although I have a German Wordpress installed (Backend is in German)?  So I saved it and also as a .mo file and uploaded both files on my server into the languages folder. But the translations are not working
41679
I'm trying to write a single backslash in a comment as code formatted by backtick. Like this:  `\`   but it escapes the backtick and doesn't close the "inline code block".  I've read  but couldn't figure out.  How do I format a single backslash in comment as code?
91211
I am currently writing my thesis and need to include a bunch of email conversions. I am using classicthesis. I wonder, how you would format stacked conversions. Moreover, how would you deal with the email header, signatures and line breaks: why do I need to add \\ all the time? This is the configuration I am currently experimenting with:  \documentclass[ oneside, openright, titlepage, dottedtoc, numbers=noenddot, headinclude, footinclude=true, cleardoublepage=empty, abstractoff, BCOR=5mm, paper=a4, fontsize=11pt, ngerman, american ] {scrreprt}  \PassOptionsToPackage{utf8}{inputenc} \usepackage{inputenc} \usepackage{blindtext}  \usepackage{framed}  % Vertical line that highlights quotations in an email. % Use \begin{leftbar} and \end{leftbar} environment. % Width of the line = 0.4pt % Space between the line and the text = 10pt % Requires \usepackage{framed} \renewenvironment{leftbar}{%   \def\FrameCommand{\vrule width 0.4pt \hspace{10pt}}%   \MakeFramed {\advance\hsize-\width \FrameRestore}}% {\endMakeFramed}  \usepackage{nicefrac} \usepackage[english]{babel} \usepackage[pdfspacing]{classicthesis}  \begin{document} \selectlanguage{ngerman} % american ngerman % Disable paragraph indentation. \setlength{\parindent}{0pt}     \begin{verbatim} From: john.doe@yahoo.com Subject: Your inquiry from 20042012 Date: Thu, 3 May 2012 11:34:54 +0200 To: Jane Doe &lt;jane.doe@hotmail.com&gt; \end{verbatim}  Jane Doe wrote: \begin{leftbar} \begin{leftbar} \begin{leftbar} \begin{leftbar} There are a couple of questions I like to ask. Please forward them if you cannot do so. \end{leftbar} I hope I can answer them after holidays. \end{leftbar} I am back from holidays now and will look through your questionaire the next days. \end{leftbar} Thank you, Mr. Doe - I am awaiting your answers. \end{leftbar}  Dear Mrs. Doe,\\ \ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut molestie placerat pharetra. In quam leo, tincidunt ut consequat eget, malesuada sit amet urna. Morbi et interdum arcu. Nullam nisi nunc, ullamcorper vitae pulvinar eu, suscipit ut augue.\\ \ Donec risus mi, accumsan ac interdum id, molestie sed mauris. Suspendisse porttitor luctus justo in ullamcorper. Proin in neque magna. Mauris quis arcu eget enim mattis pharetra vitae a dolor. Nam aliquam consectetur mollis. Ut at sem quis dolor faucibus fringilla. Quisque cursus vehicula odio, vitae placerat ipsum dapibus id.\\ \ Best regards\\ John Doe\\ \ (See attached file: Questions\_Doe.doc)  \begin{verbatim} _______________________________________________________ Administration New York John Doe Mainstr. 3 11111 New York  T:        (011) 212-4301 F:            (011) 212-954301 M:         john.doe@yahoo.com \end{verbatim}  \begin{leftbar} My question I looking forward to reading the answers to my questions:\\ \ 1. Is the world analog or digital? \end{leftbar} digital  \begin{leftbar} 2. How long does the world exist?  \end{leftbar} analog since 1984, digital since 1999  \end{document}     This is what the above latex example looks like.    I also saw  but I do not want to use &gt; or colors. My settings are inspired by this  and this .
78261
Is there any way that I can change how a Literal of a code snippet renders when it is used in the code that the snippet generates?  Specifically I'd like to know if I can have a literal called say, $PropertyName$ and then get the snippet engine to render "_$PropertyName$ where the first character is made lowercase.  I can't afford R#.  Please help :)
96335
I have this problem with a view's header. I am allowed to enter a translation but the translated text is not rendered when the view is displayed in that language. I have the following warning in the Views interface.  content for textgroup views is not allowed for translation because of its text format  I read other posts suggesting to visit Configuration » Regional and language » Multilingual settings and verify the text format is selected. These posts were addressing the problem for blocks and they didn't solve my problem. Any similar experience or solution?
21853
I wrote the following code to typeset the title page of a paper:  \documentclass{amsart}  \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[USenglish]{babel}  \begin{document}  \title[Title Title Title]{Title Title Title}  \begin{abstract}     Abstract abstract abstract \end{abstract}  \maketitle  \end{document}   This outputs the following:    However, I wanted to make my title a macro, because I need it elsewhere too:  \documentclass{amsart}  \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[USenglish]{babel}  \newcommand\mytitle{Title title title}  \begin{document}  \title[\mytitle]{\mytitle}  \begin{abstract}     Abstract abstract abstract \end{abstract}  \maketitle  \end{document}   But this now outputs the following:    No way of fiddling got me the capitalization back. E.g. there is no difference in using \def. What is happening here and how to fix it?
101680
If I want to show the current node title in page.html.twig (by default it seems to only be available in node.html.twig) I have to create a preprocess function like so:  function theme_preprocess_page(&amp;$variables, $hook) {   // Set our page title so we can access it in page.html.twig   if ($node = \Drupal::routeMatch()-&gt;getParameter('node')) {     $variables['my_node_title'] = $node-&gt;title-&gt;value;   } }   And then I have to overwrite page-title.html.twig by copying it into my current theme folder and commenting out everything.  This doesn't seem "right".  Is there a better way?
25473
If you don’t have 25k reputation, the  contains a stub text:        As you can see on the image, the dot should be moved outside the quotes. Also, on ruSO we need to  from “” to «», but this is not possible via Transifex, because there is no full sentence available to translate.
15704
I know it's of course a dispute whether or not to support foreign languages on StackOverflow. However, my question is a bit different.  is in English, but has code with comments and identifiers in a foreign language. This limits the ability for people to leave answers.  Despite the fact that the example question I linked is poor regardless of language barrier, how should we [the users] handle such questions? Should we...   Accept them into StackOverflow and try to translate them? Cast close votes because we cannot understand to answer? Ask the OP to translate it to English for us? Wait for someone else to come translate it for us?   The same also applies when the code its self includes identifiers in a foreign language. In case this original question I linked gets deleted, here's the source from that question:  procedure TForm1.Button1Click(Sender: TObject); var   X: Integer; begin   for x := 1 to 5 do     if Sender = Botones[x] then //Valida el Boton que provoco el evento     begin       Codigo := x;   //Captura la posicion donde se eonctro el objeto que generó el evento       // ShowMessage(IntToStr(x));       Exit; //sale del bucle     end; end;
6971
I have a view and added the title as a field. For example: How do I print the title?  In Drupal 7 it was as simple as views-view-fields--[viewname].tpl.php &lt;?php print $fields[&quot;title&quot;]-&gt;content; ?&gt;   How do we do this in Drupal 8? I have created views-view-fields--[viewname].html.twig I thought it might be {{ fields.title }} but I get the classic error message like so:  The website encountered an unexpected error. Please try again later.  I then tried {{ field.title }}, {{ title }} and {{ content.title }} but nothing prints.
96808
Speaking of tilesource urls such as   http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.png  is there any technical documentation or canonical reference for the curly braces syntax?  I'd specifically like to know what other things can be used in curly braces, and in which places, and how they work.