Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font
To setup native Linux, see this gist
Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font
To setup native Linux, see this gist
(function($) { | |
/** | |
* jQuery function to scroll the viewport middle to the element. | |
*/ | |
$.fn.scrollToMiddle = function(options) { | |
var settings = $.extend({ | |
duration: 1000 | |
}, options ); | |
return this.each(function() { |
If you should encounter the problem that some translations are wrongly translated with the equal source language string (for example in our case there were German translations for "Author" translated with "Author" or "Published" with "Published"), you may use the following snippet to list them.
SELECT s.lid,s.source, t.translation FROM `locales_source` s
INNER JOIN locales_target t
WHERE s.lid=t.lid AND CONVERT(s.source USING utf8) = CONVERT(t.translation USING utf8)
AND t.customized=1
To finally delete them, you may use something like this, but make a backup before and know what you're doing!
/** | |
* Helper function for adding translations. | |
* | |
* @param array $strings | |
* The array with strings and their translations. | |
*/ | |
function _my_module_add_translations(array $strings) { | |
// Get locale storage service. | |
$storage = \Drupal::service('locale.storage'); |
This is the Gist repository for my article Drupal 8, How to translate Config API.
Be aware that this article has been wrote for the Blog of Antistatique — Web Agency in Lausanne, Switzerland. A place where I work as Full Stack Web Developer.
Feel free to read it the full article on Medium or check it out on Antistatique.
Content of this Gist :
<?php | |
// Import arbitrary config from a variable. | |
// Assumes $data has the data you want to import for this config. | |
$config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html'); | |
$config->setData($data)->save(); | |
// Or, re-import the default config for a module or profile, etc. | |
\Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_module'); |
# https://www.ionos.com/community/hosting/php/using-php-composer-in-11-ionos-webhosting-packages/ | |
php -v | |
# PHP 4.4.9 (cgi-fcgi) (built: Nov 7 2018 13:27:00) | |
# Copyright (c) 1997-2008 The PHP Group | |
# Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies | |
/usr/bin/php7.1-cli -v | |
# PHP 7.1.25 (cli) (built: Dec 10 2018 10:11:36) ( NTS ) | |
# Copyright (c) 1997-2018 The PHP Group |
custom_view: | |
css: | |
component: | |
css/custom_view.css: {} |
drush eval "var_dump(Drupal\Component\Utility\Crypt::randomBytesBase64(55))" |