Laravel Voyager:翻译不适用于帖子和页面

时间:2018-05-14 10:32:58

标签: php laravel laravel-5 laravel-5.6 voyager

我正在尝试将ar语言添加到我的网站,但我遇到问题是正文没有保存它保存<p>&nbsp;&nbsp;</p>

我在打印时使用2种语言 ar zh_ 更新帖子时收到了打印请求。

请求与一些虚拟文本一样

Request {#57 ▼
  #json: null
  #convertedFiles: array:2 [▶]
  #userResolver: Closure {#1935 ▶}
  #routeResolver: Closure {#1994 ▶}
  +attributes: ParameterBag {#67 ▶}
  +request: ParameterBag {#66 ▼
    #parameters: array:17 [▼
      "_token" => "LjyJ1cgN5tn7yxFbjyHRPAnRzqRKWg8ojRYM7cMP"
      "title_i18n" => "{"en":"Data Services","ar":"خدمة البيانات"}"
      "title" => "Data Services"
      "body_i18n" => "{"ar":""}"
      "body" => """
        <pre style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 11.9px; margin-top: 0px; mar ▶
                 * Set whether or not the multilingual is supported by the BREAD input.\r\n
                 */\r\n
                'bread' =&gt; true,</code></pre>
        """
      "excerpt_i18n" => "{"en":"as ds as d","ar":"as das s dsa"}"
      "excerpt" => "as ds as d"
      "slug_i18n" => "{"en":"data-services1","ar":"khdmh-albyanat"}"
      "slug" => "data-services1"
      "status" => "PUBLISHED"
      "category_id" => "3"
      "meta_description_i18n" => "{"en":"as das dsa d","ar":"asd as dasd a"}"
      "meta_description" => "as das dsa d"
      "meta_keywords_i18n" => "{"en":"as das","ar":"a sdas "}"
      "meta_keywords" => "as das"
      "seo_title_i18n" => "{"en":"Design and conduct surveys and measure relevant indicators in all areas","ar":"Design and conduct surveys and measure relevant indicators in all areas"}"
      "seo_title" => "Design and conduct surveys and measure relevant indicators in all areas"
    ]
  }
  +query: ParameterBag {#65 ▶}
  +server: ServerBag {#70 ▶}
  +files: FileBag {#69 ▶}
  +cookies: ParameterBag {#68 ▶}
  +headers: HeaderBag {#71 ▶}
  #content: null
  #languages: null
  #charsets: null
  #encodings: null
  #acceptableContentTypes: null
  #pathInfo: "/admin/posts"
  #requestUri: "/admin/posts"
  #baseUrl: ""
  #basePath: null
  #method: "POST"
  #format: null
  #session: Store {#2051 ▶}
  #locale: null
  #defaultLocale: "en"
  -isHostValid: true
  -isForwardedValid: true
  basePath: ""
  format: "html"
}

我的voyager.php for multilanguage config就像这样

'multilingual' => [
    /*
     * Set whether or not the multilingual is supported by the BREAD input.
     */
    'bread' => true,
    /*
     * Set whether or not the multilingual is supported by the BREAD input.
     */
    'enabled' => true,

    /*
     * Set whether or not the admin layout default is RTL.
     */
    'rtl' => false,

    /*
     * Select default language
     */
    'default' => 'en',

    /*
     * Select languages that are supported.
     */
    'locales' => [
        'en',
        'ar',
    ],
],

会出现什么问题?

1 个答案:

答案 0 :(得分:-1)

我搜索了很多,最后我试图通过转身来解决它。解决方案或者说这里的问题在这个文件中:

  

帖/附加edit.blade.php

如果你删除它,面包将完美地与默认模板一起使用post add-edit。我认为这会有所帮助,但我不知道为什么会出现这个问题。