Drupal 9.4 is ignoring my translation info - localization

The ...info.yml:
name: CEnquire
version: '9.x-1.3'
description: BlahBlah
package: CPackage
type: module
core_version_requirement: ^8 || ^9
interface translation project: cenquire
interface translation server pattern: modules/cpackage/cenquire/translation/%project-%version.%language.po
The language: Ukrainian (uk)
The .po file is named cenquire-9.x-1.3.uk.po and placed in proper directory
drush locale-check just ignores yml data: I don't get any Translation file not found errors. The site just has no data about any translation for the project exists. This is not a cache issue.
What am I doing wrong?

Related

How to correctly compile a quarto website with nested folder structure?

I am experimenting with quarto to see how I can create a website. These are the steps that I have followed so far:
Open RStudio (RStudio Server 2022.02.0 Build 443)
Go to File > New Project... > New Directory > Quarto Website > type Directory name: > Create Project
Go to Build > Render Website
This works fine! However, when I try to add a section for blog, the website doesn't compile correctly. Here's what I did:
Create a blog folder under root
Create a file blog/index.qmd
Create a blog/posts folder
Create a blog/posts/test-post folder
Add files index.qmd and featured.jpg to blog/posts/test-post folder
Run this code in R console to add featured.jpg file:
download.file(
"https://upload.wikimedia.org/wikipedia/commons/3/3f/August_Macke_-_Three_girls_in_yellow_straw_hats_I_-_Google_Art_Project.jpg",
"blog/posts/test-post/featured.jpg"
)
Here are the contents of the blog/index.qmd file:
---
title: This is my blog.
listing:
contents: posts
type: default
---
Here are the contents of the blog/posts/test-post/index.qmd file:
---
title: My first blog post.
image: featured.jpg
---
Here are the contents of the _quarto.yml file:
project:
type: website
website:
title: "test-quarto-web"
navbar:
background: primary
left:
- href: index.qmd
text: Home
- about.qmd
- href: blog/index.qmd
text: Blog
format:
html:
theme: cosmo
css: styles.css
editor: visual
After I render the website and click on the Blog menu, this is what I see:
How can I fix this issue? I believe there is some problem with the file path, but I couldn't figure out how to fix this!
In my experience, this is frequently due to using an old version of Quarto. As Quarto is nearing release, there are improvements happening daily.
To install the latest version from Quarto, follow the instructions here. Use the "Latest Quarto version" tab.
If you install a new version, RStudio Desktop will recognize it.

Doing incomplete translations with sphinx is showing default language only?

After following the official workflow for translating files I find myself in a situation where the translation doesn't seem to work.
make gettext
sphinx-intl update -p /source/_build/gettext -l fr
set SPHINXOPTS=-D language=fr
make html
I have successfully created *.pot and *.po files and testwise translated parts of this *.po-file (other msgid's still default to "". Then I set the language to french and run make html again - but the text that I translated isn't displayed in french.
Nothing in the build output shows any hint on what's wrong:
C:\dev\ritune\docs>make html
Sphinx v4.1.2 in Verwendung
Lade Übersetzungen [fr]…erledigt
making output directory... erledigt
[autosummary] generating autosummary for: .roles.rst, configuration\add_modules\add_modules.rst, configuration\db_dump\db_dump.rst, configuration\index.rst, configuration\modules\config_dashboard\config_dashboard.rst, configuration\modules\index.rst, configuration\plotly_diagrams\plotly_diagrams.rst, data_explorer\data_explorer.rst, functions\asset_management\asset_management.rst, functions\dashboard\dashboard.rst, ..., system\index.rst, system\logs\logs.rst, system\main_menu\main_menu.rst, system\physical\physical.rst, system\proc\proc.rst, system\settings\settings.rst, system\tags\tags.rst, system\user_profile\user_profile.rst, system\users_roles\users_roles.rst, system\versions\versions.rst
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
loading intersphinx inventory from https://www.sphinx-doc.org/en/master/objects.inv...
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 81 source files that are out of date
updating environment: [new config] 81 added, 0 changed, 0 removed
reading sources... [100%] system/versions/versions or2ntrol
looking for now-outdated files... none found
pickling environment... erledigt
checking consistency... preparing documents... erledigt
writing output... [100%] system/versions/versions r2ntrol
generating indices... genindex erledigt
writing additional pages... search erledigt
copying images... [100%] system/versions/version_numbering.svg 1fcb54c2ee.png
copying downloadable files... [ 57%] modules/reporting_masks/Betriebsstatistik_Vorlage_20210514.xlsx_Betriebsstatistik_Vorlage_20210514.xlscopying downloadable files... [100%] system/alarms/ANSI-ISA-18.2 - Management of Alarm Systems for the Process Industries.PDF
copying static files... erledigt
copying extra files... erledigt
dumping search index in French (code: fr)... erledigt
dumping object inventory... erledigt
build abgeschlossen, 13 warnings.
Note that I excluded warnings that have to do with silly syntax mistakes I made in one of the files (the one I'm currently working on).
Is this expected behaviour or am I doing something wrong? I wanted to test the translation functionality and my *.po files.
I found the solution. Sphinx didn't actually pick up on the .mo (binary) files.
Steps to retrace for correct working:
Make sure you're in root directory and you see build and source directories
Using sphinx gettext will create *.pot files in build/gettext
Take those *.pot files and translate to *.po files using sphinx-intl update -p build/gettext -l fr (example for french/'fr'). This will create *.po files in a new folder locales which by default sits amongst the build and source dirs under root.
Translate *.po files
Now make sure that locale_dirs = ['../locales'] in conf.py points to the directory of the locales! This was not set up properly by default in my case. I had to change dir to parent ( ../ ) and use "locales" instead of the default "locale" to describe the path.
Run sphinx-intl build to create binaries (*.mo) out of *.mo files.
Set language to french for current terminal: set SPHINXOPTS=-D language=fr
make html

swagger-codegen is not correctly generating common parameters for any language

According to the swagger documentation, I should be able to have common parameters that are shared by all operations. The problem is that when running codegen locally, the generated code does not have any of the common path parameters. The below yaml produces code for any language (I've tried two).
What is very confusing is that if I use this exact yaml in https://editor.swagger.io/, the generated code does have the path parameters. I ran this for two different languages, typescript:
And C#:
Left is the code generated in editor.swagger.io and right is my generated code by running codegen locally.
In both cases, the .swagger-codegen\VERSION the file is 3.0.20 which is the one I'm using but the code generated by https://editor.swagger.io/ does have the parameter paths.
This simple yaml file reproduces the issue:
openapi: 3.0.2
info:
title: title
version: 1.0.0
paths:
'/instances/{id}':
summary: Manipulate a particular instance
get:
responses:
'200':
description: Ok
content:
text/plain:
schema:
type: string
example: pong
summary: Fetches an instance
parameters:
- in: path
name: id
schema:
type: integer
required: true
components:
securitySchemes:
bearerAuth:
scheme: bearer
bearerFormat: JWT
type: http
The command line used for generation:
java ^
-classpath bin/swagger-codegen-cli.jar ^
-DdebugOperations ^
io.swagger.codegen.v3.Codegen ^
generate ^
-i enterpos-api.yaml ^
-l typescript-angular ^
-o generated-code/typescript-angular-builtin
And that generated this output: https://gist.github.com/alanboy/45ce792255e079dd0de4f70449ebf455. I feel like this might be wrong usage or something wrong with my yaml but I can't figure out what.
The problem is the Main class. I noticed that using the io.swagger.codegen.v3.Codegen class produces incorrect results :
java -classpath bin/swagger-codegen-cli.jar io.swagger.codegen.v3.Codegen <more>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
But this works:
java -jar bin/swagger-codegen-cli.jar <more>
Which led me to open MANIFEST.MF in the jar and notice the main class is actually this:
Main-Class: io.swagger.codegen.v3.cli.SwaggerCodegen
I then ran the command like this and everything worked as expected.
java -classpath bin/swagger-codegen-cli.jar io.swagger.codegen.v3.cli.SwaggerCodegen <more>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

dajax.core ImportError at /No module named

I've installed dajaxice by this tutorial:
Copied folder "dajaxice" (from archive) to project folder.
Added all changes to setting.py & urls.py
Added next lines to template:
{% load dajaxice_templatetags %}
{% dajaxice_js_import %}
Created ajax.py in the project folder
Code from ajax.py:
from django.utils import simplejson
from dajaxice.core import dajaxice_functions
#dajaxice_register
def example1(request):
return simplejson.dumps({'message': 'hello world'})
dajaxice_functions.register(example1)
Code from .js file:
$("#id_submit").click(function(){
Dajaxice.theproject.example1(callback_example);
console.log("test clicked");
return false; });
When I restart the project in browser at first request I got:
ImportError at / No module named dajax.core
Request Method: GET
Request URL: http:// 127.0.0.1:8000/
Django Version: 1.4
Exception Type: ImportError
Exception Value: No module named dajax.core
Exception Location: C:\Python27\lib\importlib\__init__.py in import_module, line 37
Python Executable: C:\Python27\python.exe
Python Version: 2.7.3
Python Path: ['E:\\Projects\\py\\sites\\theproject', 'C:\\Windows\\system32\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages', 'C:\\Python27\\lib\\site-packages\\PIL']
Server time: Fri, 3 Aug 2012 14:50:03 +0300
Any ideas?
load ajax.py in init.py(of main app)
Dajaxice is updating all the time. Make sure you have downloaded and installed the correct version of Dajax for the document you are reading. In your error message, it says, "No module named dajax.core", which is probably because you are using the wrong version.
And the current version of Dajaxice and Dajax can be found here:
https://pypi.python.org/pypi/django-dajax
https://pypi.python.org/pypi/django-dajaxice/0.5.5

symfony 1.4.8+ doctrine --> doctrine:build-schema fatal error opening required /tmp/tmp_doctrine/User.php

I'm trying out symfony so i started installing it on a remote mashine thru ssh (normal user, no root access)
when getting to the part where i want to generate the db-schema out of a existing mysql database with doctrine by issuing the following command:
./symfony doctrine:build-schema
i get the following errors:
Warning: require_once(): '/tmp/tmp_doctrine_models/User.php' is not a valid path for inclusions, since it includes /tmp/ in /home/users/mpretftp/test1/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Core.php on line 668
Warning: require_once(/tmp/tmp_doctrine_models/User.php): failed to open stream: Success in /home/users/mpretftp/test1/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Core.php on line 668
Fatal error: require_once(): Failed opening required '/tmp/tmp_doctrine_models/User.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/users/mpretftp/test1/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Core.php on line 668
by 'doing it the other way around', create the database.yaml like this:
User:
actAs: { Timestampable: ~ }
columns:
id: { type: integer, notnull: true }
hash: { type: string(255), notnull: true }
then trying out ./symfony doctrine:build --model i'm getting the following, even weirder error:
./symfony doctrine:build --model
>> doctrine generating model classes
>> file+ /tmp/doctrine_schema_70737.yml
Invalid schema element named "0" at path "Warning"
also, the hoster (of the remote mashine) has a comment on a joomla-error message. On one side i realize that joomla has nothing to do with symfony nor doctrine. But the error message resembles the first warning i pasted above: "... is not a valid path for inclusions,since it includes '/tmp/' in ....". The suggested sollution for the joomla-error is changing the /tmp/ path to /home/users/user/tmp in the joomla configuration
my best guess would be that i need to convince doctrine to use another path as well. unfortunatly i cannot find such a configuration option for doctrine.
could anyone either tell me how to set the tmp path for doctrine/symfony or php or even the enviroment?, or where to continue 'debugging'?
Doctrine uses PHP's sys_get_temp_dir to determine the temporary path. I found this out by search the Doctrine source for 'tmp_doctrine_models'.
It seems a little strange that your host doesn't allow the temporary directory to be written.

Resources