Kayıtlar

Ocak, 2023 tarihine ait yayınlar gösteriliyor

Strapi Create New Locale with EntityService

You can create with default id in array like below: const translated = await translate ( json . value ,                                                             { from : 'en' , to : 'iw' }); const res = await strapi . entityService                     . create ( "api::general-translation.general-translation" ,{ data : { localizations :[ defaultID ], key : json . key , value : translated . text , locale : 'he' }, populate :{ localizations : true } }) You must add localizations true parameter in populate and also 

Rake Migration Error

Resim
That's error like that. rails aborted ! StandardError: An error has occurred, this and all later migrations canceled: Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for: class CreateFriendlyIdSlugs < ActiveRecord::Migration[4.2]  That problem due to rails version. So all you need to do, enter db>migrate folder and opened YOURDATE_create_friendly_id_slugs.rb file. Then add extend class name [5.1].       class CreateFriendlyIdSlugs < ActiveRecord :: Migration [ 5.1 ] def change create_table :friendly_id_slugs do | t | t . string :slug , :null => false t . integer :sluggable_id , :null => false t . string :sluggable_type , :limit => 50 t . string :scope t .datetime :created_at end add_index :friendly_id_slugs , :sluggable_id add_index :