laravel-china / laravel-docs

Laravel 中文文档
https://d.laravel-china.org
MIT License
234 stars 294 forks source link

"关于闪存数据存到 session"译文 #394

Open bigqiang opened 6 years ago

bigqiang commented 6 years ago

译文链接

有时候你仅想在下一个请求之前在 Session 中存入数据,你可以使用 flash 方法。使用这个方法保存在 session 中的数据,只会保留到下个 HTTP 请求到来之前,然后就会被删除。

原文:

Sometimes you may wish to store items in the session only for the next request. You may do so using the flash method. Data stored in the session using this method will only be available during the subsequent HTTP request, and then will be deleted.

这里正确的翻译: 有时候你仅想在 Session 中存入数据用于第二次请求,你可以使用 flash 方法。使用这个方法保存在 session 中的数据,仅会保留到下次 HTTP 请求期内有效,然后就会被删除。

查前面几个版本,问题同样存在。

JokerLinly commented 6 years ago

我看了几遍,觉得这两种翻译并没有什么不同,只是前者直白些,而后者想更清晰地阐述闪存的用法。这样改你看可好: 如果你只想将某些数据存入 Session 以便用于二次请求(比如用户操作失败、表单验证失败等 ),那就使用 flash 方法。这个方法可以将 Session 中的数据保存到下一次的 HTTP 请求前而不被删除。

bigqiang commented 6 years ago

不一定要用我的。对于技术说明文档而言,表述没有岐义不会误导的就是好翻译。